Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Displaying label at runtime

Reply
Thread Tools

Displaying label at runtime

 
 
Richard
Guest
Posts: n/a
 
      06-07-2005
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
 
Reply With Quote
 
 
 
 
Visar Gashi, MCP
Guest
Posts: n/a
 
      06-07-2005
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

 
Reply With Quote
 
 
 
 
Richard
Guest
Posts: n/a
 
      06-07-2005
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

 
Reply With Quote
 
Visar Gashi, MCP
Guest
Posts: n/a
 
      06-08-2005
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

"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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
optimizing the switch statement in Duff's Device (casting a label, label abuse) anon.asdf@gmail.com C Programming 10 10-11-2007 03:59 PM
dll config and web.config and Label Expressions (binding label text to dll config settings) CSharpner ASP .Net 0 04-09-2007 09:00 PM
How to get/read Hard disk label / drive label Praveen Python 1 11-05-2006 07:48 PM
<label><div></div></label> allowed? Josef K. ASP .Net 3 05-22-2005 02:13 PM
label versus asp:label Question. Thanks. Shapper ASP .Net 2 05-07-2005 05:55 AM



Advertisments