Click here to Skip to main content
15,891,184 members

Comments by piyush_singh (Top 11 by date)

piyush_singh 5-Dec-13 8:27am View    
If the value of the dropdownlist is not affected by postback, then you should definitely set its datasource only once inside the !ISPostBack. Now since, on each postback, the whole page is rendered, you need to store your custom values (such as Dictionary in this case) somewhere. That's where comes, Sessions & ViewStates. If you want to persist your data across multiple pages then, use Session. If you want to hold the value as long as the current page is active then, use ViewState. So that the values will be cleared when the user navigates to some other pages. Since session variables remains active as long as the current session is active it is usually advised not to keep heavy objects in it as it will slow down your application.
piyush_singh 5-Dec-13 8:05am View    
You can easily achieve it using javascript.
piyush_singh 27-Nov-13 6:22am View    
I think you should confirm whether the connection string is correct or not.
piyush_singh 25-Sep-13 1:55am View    
Sorry, I didn't get it this time. If you say that its working, then the problem is solved right?? Otherwise, if, your alert message is fixed, then you can use the OnClientClick property for a button (or any other asp control) to fire the alert box.
piyush_singh 24-Sep-13 5:45am View    
First check in the first line, are you getting any rows for the table, dtChanged. Because if there are no rows then, your foreach loop will not be executed.

Secondly, what is the error, that you are getting when running this code.

Thirdly, inside the foreach loop, you're twice checking the value of drChanged["Choosen"], which is unnecessary.