Ispostback Asp.net

Asked

Viewed 104 times

1

My Asp.net application (aspx) has two Label-type Controls that need to be filled with information from a Request Querystring. In Page_load I do the treatment so that the Controls of type Label receive this information and actually receive, but do not render, that is, it is not displayed on the page. I did a test by placing constants in place of the values of Request Querystring and when I do this the Label type Controls appear filled. What could this be? I read a lot about Viewstate and his commands but none solved.

insira o código aqui
<asp:Panel ID="panFeedBack" runat="server">
    <div class="row">
        <div class="col-xs-8">
            <div class="control-group">
                <div class="controls">
                    <asp:Label ID="lblMarcacao" runat="server"></asp:Label>
                </div>
            </div>
        </div>
    </div>
</asp:Panel>


insira o código aqui
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Request.QueryString.Item("id") Is Nothing Then
        Dim QueryStrMarcacao As String = Request.QueryString.Item("id").Split("|")(1)
        lblMarcacao.Text = "Marcação: " & QueryStrMarcacao
    End If
End Sub
  • Post your code so it’s easier to assist

1 answer

0

Try the code:

If Not Request.QueryString("id") Is Nothing Then
     Dim QueryStrMarcacao As String = Request.QueryString("id")
     lblMarcacao.Text = "Marcação: " & QueryStrMarcacao
End If

Follow Images: VB code: https://uploaddeimagens.com.br/imagens/capturar-png--4018

ASP code: https://uploaddeimagens.com.br/imagens/asp-png

Page: https://uploaddeimagens.com.br/imagens/pagina-png--30

As for the Viewstate, it is the form of the . net "identify" the status of the page, for example the "Ispostback" used in Page_load, it identifies if it is the first time you are accessing the page, so it is not a postBack (Reload of the page), but if used any item on the page that generates postBack, example a droDownList that loads another, the page will generate a postBack and through this identification you will be able to keep the status of the items on the page

  • I followed the suggestion and the same happens. .

  • From a glance at the images I uploaded, you even tried to do this on another page?

  • On another site where use masterpage this works great, but in this specific case the only difference is the page be an aspx without masterpage.

  • ai complicou rsrs. finally, tried to leave without if? to see if at least the word "Markup" is written?

  • If you take if and also any allusion to Request Querystring the word "Markup" is written

  • Querystring is fired by Javascript $. post('/Celular.aspx? id=' + param, {});

  • I solved the question by putting in a Sesssion receiving stops from querystring

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.