asp.net

User control - calling a vb linkbutton's(within a user control) click event from javascript

how can i call a VB function - deleteevent() in usercontrol.ascx.vb from a javascript function in clickhandler(e) in usercontrol.ascx. The call should cause a postback because i need the usercontrol to display the changes. i am currently trying to do it by using a linkbutton with style display:none, and calling its click event from the ...

File Upload link clears when page reloads, why?

I am using ASP.net(2.0) with VB.NET. I have a User registration form. On that form the user supply all his contact details and he can upload a image with the normal file upload control in ASP.net. This is my problem. If anything goes wrong on the page then i give the User a error message saying what he left out or what went wrong. But ...

Dynamically generated WebUser Control

I have two WebUser Controls which are dynamically added to the Webform a number of times according to the user input from a previous page. There are some textboxes and drop downs in the WebUser control. I need to get the values from the textboxes of the WebUsercontrol which are added dynamically. How do I do that? ...

What is the best way to implement a plugin architecture for asp.net webforms application?

We have a 3-tier web application written in ASP.Net Webforms where we will not be able to port it - recession really sucks! - to MVC. Our goal is to implement a plugin architecture. One way would be to use the App_Code folder. Are there any better alternatives? ...

Only supporting users who have Javascript enabled.

I am considering creating a website that only supports users with JavaScript enabled. My justification for this is that I want to offer a rich user experience, in a fairly limited time budget, so if I only support people who have JS enabled, I don't have to spend time making sure the UI works without JS and create server side equivalent...

Databinding expression for retrieving value of related collection using LINQ

I have a GridView that is bound to a LINQDataSource control that is returning a collection of customers. Within my DataGrid I need to display the home phone number of a customer, if they have one. The phone numbers of a customer are stored in a separate table with a foreign key pointing to the customer table. The following binding exp...

Best way to create a folder and upload a image to that folder in ASP.NET?

Hi Any code examples on how i must go about creating a folder say "pics" in my root and then upload a images from the file upload control in into that "pics" folder? If you don't want to give me all the code, i will be happy with a nice link also to show me how this will be done in VB.NET (C# is also ok). Thanks in advanced!!! ...

HTML 'name' attribute generated for ASP.net child controls, instead of the unique 'ID' attribute

The generated HTML code for my custom ASP.net server control generates the name attribute for child controls, instead of the id attribute. Something like this : <span id="GridView2_ctl02_editdis"> <input type="text" name="GridView2$ctl02$editdis$ctl00"/> </span> The ID for the custom control itself is apparently proper. What is e...

cannot find xml path error

I feel kinda stupid to even ask that question, But i was sitting like an hour trying to figure out how to solve the problem. I am currently making a project that uses ASP.NET and XML, for my project i created new web site from Visual Studio, and trying to keep my XML files in App_Data. However when i trying to use code: var topic = fro...

HttpContext.Error vs HttpContext.Server.GetLastError()

Are there any practical differences between these two ways of getting an exception for the current asp.net request? MSDN says HttpContent.Error returns the FIRST error while GetLastError() is evidently the last error, but I can't seem to tell any difference in use. Which one is the cannon method for error logging? ...

Preferred DB Connection for ASP.Net

What's the preferred (best practice) means of connecting an ASP.Net Website to a database? I doubt it's as simple as using Trusted-Connection and giving the NT-Authority accounts access. What do y'all do? Assuming a clean install of SQL Server (2008), what do you do to configure access to the database for a website? ...

how do i invoke asp.net regExp validator from javascript?

Hello, I'm developing in asp.net 2.0. I'm using the asp:RegularExpressionValidator to check for a valid url. How do I invoke the check from a javascript function? ...

Serializable Class Collections

I have a class that contains a list of properties which serializes just fine. However I need one of those properties to contain a collection of another class to give me sub classes Example XML <VideoOptions> <property1>value1</property1> <property2>value2</property2> <property3> <item> <property1>value1</property1> </item> <item> ...

Is there an automatic way in ASP.NET to tell which resources are not used anywhere in code and markup?

I believe lots of us have been presented with a challenge to check manually through hundreds of string constants to check which ones are used and which are not (orphans). Although I do not have that many yet in my current project, I still find it difficult already to do a code review and check for dropped constants manually. Is there an...

how to create pluggable ASP.Net website ?

hi, what are the best practices to create a site, with ability to develop plug ins for it ? like you want to create a Blog module, and you want users or co developers to add plugins to extend this module functionality thanks in advanced. Update: man thanks so much for hte ultra speed answers, but i think this is over kill for me, is ...

Subsonic 2.2 and EnterpriseLibrary 4.1 in Framework 2.0

Hi i use subsonic version 2.2 in my project and this version of subsonic use EnterpriseLibrary 4.1 but i use EnterpriseLibrary 3.1 because i use framework 2.0, the version 4.1 need framework 3.5 or later, the problem is when i use subsonic in the web config i have this and when is load fail, and showme this Could not load file or as...

Shouldn’t Bind() pass child control’s values to GridView before Page.PreRender?

hello, For controls such as the GridView, DetailsView, and FormView controls, data-binding expressions are resolved automatically during the control's PreRender event But doesn’t data source control perform updates prior to Page.PreRender event? Meaning, shouldn’t Bind() pass child control’s values to GridView ( so they can be pas...

GridView and Load Postback Data stage

Hello, Q1 A) On a postback, when in the page’s life cycle are GridView’s rows populated with all the values it had before user issued a postback? Thus at what point does GridView already have all the values it displayed on user’s page? I’m assuming this happens the same time it happens with other controls, which is during Load View...

Why can’t GridView extract child control’s values directly?

Hello using Bind in a GridView control template enables the control to extract values from child controls in the template and pass them to the data source control. The data source control in turn performs the appropriate command for the database. For this reason, the Bind function is used inside the EditItemTemplate or InsertItemTem...

Tracking users and sessions on an asp .net website

I'm looking to write a user and session tracking tool. What I'm trying to do is create a page that lets me see which users are logged in and what session data is being used by that user. Is this possible? Or do I need to write a custom session provider? ...