Click here to Skip to main content
12,445,865 members (60,164 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET4
defaut.aspx page coding

    <form id="form1" runat="server">
        welcome: &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
        <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Label"></asp:Label><br />
        You visted on: &nbsp;
        <asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Label"></asp:Label></div>
        <br />
        <hr width="40%" align="left" />
        <br />
        <br />
        Enter your name: &nbsp;&nbsp;
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>&nbsp;
        <asp:Button ID="Button1" runat="server" Text="Save"  />

defaut.aspx.cs coding

public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
            string hh;
            hh = Request.QueryString["name"].ToString();
            Profile.Name = hh;
            Label1.Text = hh;
    protected void Page_UnLoad(object sender, EventArgs e)
        Profile.VisitedOn = DateTime.Now;

 page coding from which i will send a name to default page through
query string
<head runat="server">
Posted 8-Nov-12 5:58am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

<asp:Label ID="Label1" runat="server" Font-Bold="True" Text="Label">

See the Text="Label" part in bold above? Specify whatever text you want to see here when the page is loaded directly and that should be it.

If the text is dynamic (either coming from database or based on some logic), change it in your Page_Load event of the page.
rameshkumar55 9-Nov-12 0:13am
i want client side change in text of label that should not be retained page redirection
Ankur\m/ 9-Nov-12 0:20am
Use JavaScript then. Decide the event based on when do you want to change it. If it's page load, use window's onload event. Search Google for how to change label text javascript and you will find how to do it.
hope that helps!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160811.3 | Last Updated 8 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100