|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Displaying label at runtimethe user click's a linkbutton to process the report, either a datagrid is filled and made visible on the same form, or another form opens to show the results. Either way, I want a status label to appear on the current form to say "Processing report. Please wait" Unfortunately the label never appears when I set lblStatus.Visible = True in the linkbutton's click event. Short of async processing, how can I quickly display the label when a user clicks a linkbutton? Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If ddlReports.SelectedItem.Value <> "-1" Then 'Show the label...this never works. lblStatus.Visible = True Response.Redirect(ddlReports.SelectedItem.Value, False) Else ShowMessageBox(Me, "Please select a report from the list.") End If End Sub That is not going to work because you're making a change on that page and
then telling it to redirect from it. When you redirect, no further processing on that page will occur. What you can do is on the destination page use some java script to display the "loading..." text that will disappear when "onload" of the page completes (this java script even fires when the whole page finishes loading). Regards, -Visar Show quoteHide quote "Richard" wrote: > I have a Webform with a dropdownlist for selecting reports to process. When > the user click's a linkbutton to process the report, either a datagrid is > filled and made visible on the same form, or another form opens to show the > results. Either way, I want a status label to appear on the current form to > say "Processing report. Please wait" Unfortunately the label never appears > when I set lblStatus.Visible = True in the linkbutton's click event. > > Short of async processing, how can I quickly display the label when a user > clicks a linkbutton? > Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles btnSubmit.Click > > If ddlReports.SelectedItem.Value <> "-1" Then > 'Show the label...this never works. > lblStatus.Visible = True > Response.Redirect(ddlReports.SelectedItem.Value, False) > Else > ShowMessageBox(Me, "Please select a report from the list.") > End If > > End Sub Thanks Visar. That won't work well with this scenario because the report
displays quickly on the destination page--it is the source page where there is up to 10 second wait from the time the user clicks the button until the destination page displays with the populated datagrid. Show quoteHide quote "Visar Gashi, MCP" wrote: > That is not going to work because you're making a change on that page and > then telling it to redirect from it. When you redirect, no further processing > on that page will occur. > > What you can do is on the destination page use some java script to display > the "loading..." text that will disappear when "onload" of the page completes > (this java script even fires when the whole page finishes loading). > > Regards, > -Visar > > "Richard" wrote: > > > I have a Webform with a dropdownlist for selecting reports to process. When > > the user click's a linkbutton to process the report, either a datagrid is > > filled and made visible on the same form, or another form opens to show the > > results. Either way, I want a status label to appear on the current form to > > say "Processing report. Please wait" Unfortunately the label never appears > > when I set lblStatus.Visible = True in the linkbutton's click event. > > > > Short of async processing, how can I quickly display the label when a user > > clicks a linkbutton? > > Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles btnSubmit.Click > > > > If ddlReports.SelectedItem.Value <> "-1" Then > > 'Show the label...this never works. > > lblStatus.Visible = True > > Response.Redirect(ddlReports.SelectedItem.Value, False) > > Else > > ShowMessageBox(Me, "Please select a report from the list.") > > End If > > > > End Sub You could, then, try an intermediate page with "Loading" information. For
example, you could create a page that only redirects and while it's redirecting, it's showing a "Loading..." message. The page would only have something like <script> window.navigation.url = "destination.aspx" </script> <body> Loading... (The code is super trimmed for illustration) Regards, -Visar Show quoteHide quote "Richard" wrote: > Thanks Visar. That won't work well with this scenario because the report > displays quickly on the destination page--it is the source page where there > is up to 10 second wait from the time the user clicks the button until the > destination page displays with the populated datagrid. > > "Visar Gashi, MCP" wrote: > > > That is not going to work because you're making a change on that page and > > then telling it to redirect from it. When you redirect, no further processing > > on that page will occur. > > > > What you can do is on the destination page use some java script to display > > the "loading..." text that will disappear when "onload" of the page completes > > (this java script even fires when the whole page finishes loading). > > > > Regards, > > -Visar > > > > "Richard" wrote: > > > > > I have a Webform with a dropdownlist for selecting reports to process. When > > > the user click's a linkbutton to process the report, either a datagrid is > > > filled and made visible on the same form, or another form opens to show the > > > results. Either way, I want a status label to appear on the current form to > > > say "Processing report. Please wait" Unfortunately the label never appears > > > when I set lblStatus.Visible = True in the linkbutton's click event. > > > > > > Short of async processing, how can I quickly display the label when a user > > > clicks a linkbutton? > > > Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As > > > System.EventArgs) Handles btnSubmit.Click > > > > > > If ddlReports.SelectedItem.Value <> "-1" Then > > > 'Show the label...this never works. > > > lblStatus.Visible = True > > > Response.Redirect(ddlReports.SelectedItem.Value, False) > > > Else > > > ShowMessageBox(Me, "Please select a report from the list.") > > > End If > > > > > > End Sub
03 dropdownlist selectedindexchanged not firing in usercontrol on
Why no richtextbox in Web Controls? Can assign multiple keys to datkeys of datagrid MasterPages in ASP.NET 2.0 htmlinputfile - accept textbox postback Gridview, using Callbacks when Sorting and Paging Div and code behind on click event image showing blurred text on "forgot my password" pages? Infragistics Mousedown event is not happening |
|||||||||||||||||||||||