|
Use SelectedIndexChanged event for the dropdown and populate all the remaining dropdowns when one of the dropdown contents change.
|
|
|
|
|
I am getting all the values from the database and then bind them to the dropdown, I also want to update database as well, i dont know how to do it if you have any idea please send me some code snipshot for that.
regards
|
|
|
|
|
This has been puzzling me for very long time and no where has
talked about the scope of a 'On Error Resume Next' statement.
When we program ASP(.NET) pages then we usually like to let
ASP(.NET) stop at errors and report back to us. However there
are parts of our scripts that we know an error will be thrown
and we encapsulate that area inbetween:
On Error Resume Next
Err.Clear
'Try block
If Err.Number Then
'Catch block
End If
On Error GoTo 0
This is similar to the infamous try {} catch(e) {} blocks in
Java/C++, etc.
If we forget the last line 'On Error GoTo 0' then our ASP(.NET)
scripts runs over all errors thrown and we find it hard to
find bugs. So the big question is, does 'On Error Resume Next'
go out of scope when it's written inside a block
(eg. Function)?
Function Function1()
On Error Resume Next
'Our code
End Function
When the Function1 call returns, does the outside calling scope
automatically stays as it was (On Error GoTo 0)?
|
|
|
|
|
Yes it is scoped by the current context, but it is also the work of the devil so use sparingly.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Never, ever, EVER use On Error Resume Next. It seems like a nice idea but makes eror handling messy.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Hi!
My reporting service is running slow and hence I want to print a message 'Generating report please wait......' by using the java script below:
// Write div tag to the page that will contain the text for the progress bar.
Response.Write("");
Response.Write("_");
Response.Write(" ");
Response.Write("mydiv.innerText = '';");
// Javascript to do the work of the progress bar.
// There are three functions.
// 1. ShowWait: Sets text of the div tag to "Loading" followed by 10 periods ".........."
// 2. StartShowWait: Calls the ShowWait function every second and make the div tag visible.
// 3. HideWait: Hides the div tag when the page is done loading. It is called from a script block
// that you need to add to the HTML page as the last element.
Response.Write(";");
Response.Write("var dots = 0;var dotmax = 20;function ShowWait()");
Response.Write("{var output; output = 'Generating report please wait';dots++;if(dots>=dotmax)dots=1;");
Response.Write("for(var x = 0;x < dots;x++){output += '.';}mydiv.innerText = output;}");
Response.Write("function StartShowWait(){mydiv.style.visibility = 'visible'; window.setInterval('ShowWait()',1000);}");
Response.Write("function HideWait(){mydiv.style.visibility = 'hidden';window.clearInterval();}");
Response.Write("StartShowWait();");
Response.Buffer = true;
Response.Flush();
Then I am doing response.redirect and I get an error message as mentioned in the subject, can anyone help?????????
Many Thanks in advance.
happy coding!
|
|
|
|
|
Just do NOT use Response.Flush() - and you will be happy (can Redirect).
I can`t explain "why" - I just get the same problem and found that solution...
(web-master of RosCosmos)
|
|
|
|
|
But did you notice that if you don't use flush, it takes time to load the message and hence doesn't serve its purpose.
happy coding!
|
|
|
|
|
|
Suj_78 wrote: Then I am doing response.redirect and I get an error message
you can't redirect the page by Response.Redirect() after you have sent content to the client. The reason for this is that a Response.Redirect() sends a StatusCode to the browser to indicate that the content has moved to a different location, and the browser should check there. This StatusCode is send in the first line of headers to the browser. If you write content to the browser first you cannot then re-send that header.
A solution could be to include:
<meta http-equiv="refresh" content="3, http://www.someplace.com/somepage.aspx" />
which would redirect the browser to http://www.someplace.com/somepage.aspx after 3 seconds. see this link for more info: http://www.html-reference.com/META_httpequiv_refresh.htm[^]
hope that helps.
nicko
|
|
|
|
|
Hi fellows.
I want to generate PDF file from web.I am using C# 2.0 as code behind.
Can any b ody tell me what is the gud way og generating PDF.I want to use C# only and trying to avoid 3rd party libraries.
Kindly help me in doing so.
Ahsan Ullah
|
|
|
|
|
Ahsan-AhsanS wrote: trying to avoid 3rd party libraries
Might find this a little difficult...
|
|
|
|
|
When i try to sort my grid manually every time that i push the sort button it tries to do the function which is a function for OnROwCommand.
Can anyone help me about this please
|
|
|
|
|
Hi fellows
I have to implement maps in a web site.i have no idea how to use them.
i also want to do mapping on that map.
kindly give me some starting tips about it.
and if got any links regarding it.do refer me to them.
Thanks
Ahsan Ullah
|
|
|
|
|
|
Hi,
I have a ASP.NET web application that creates a lot of temp files (mainly images) and I am looking for suggestions on the best way to clean them up as they need to be loaded and displayed by the browser only once.
Thanks.
|
|
|
|
|
How about cleaning them up when user logs out as session clean up?
|
|
|
|
|
Hi,
I have 2 dropdownlists .One for country and another for state.I have 2 tables countries and states where countrycode is a foreign key in states table.Now I WANT TO write javascript to populate the second dropdownlist based on the country selected in the first dropdown list.I should get the data from the database.Now I want the code to accomplist this task.
With Regards,
Uma
|
|
|
|
|
|
That's horrible
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Chris Maunder wrote: That's horrible
Knew it was.. but he/she was looking for that functionality in javascript, for sometime now..
|
|
|
|
|
1. Either do a page refresh after the selection in the country dropdown has changed and populate the state dropdown serverside. This is slow and clunky
2. Use AJAX to call a page on the server when the country dropdown is changed and have the page you call return and fill the states dropdown with the states for the currently selected country
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Hi,
IS there a functionality in the GridView control to sum up the values in columns?
For example there is a GridView control which is populated with several fields from the database. Several of these fields are numbers. I would like a row at the bottom i.e. Total which shows the sum of all the values in the columns.
I do know that one way to do this is to do this in sql but wondering if this is can be done in the control itself.
Thanks
|
|
|
|
|
|
hi frenz,
i have a small doubt hope you will help me,
how to display images in gridview?
i stored image names in database, and images have in one floder
get the image name from databse
ex;from db i got image1.gif
but path is :-imagesfloder/image1.gif
i need the sample code forthis problem,
thanks,
laxman
|
|
|
|