0

hello all

i have one master page containing menu strip and one content page of same master page
what i want while i click on the menu strip the value clicked is shown to to text box on form for that i am using following code

master page's code

Partial Class MasterPage
    Inherits System.Web.UI.MasterPage



    Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick

        Session.Add("menu", e.Item.Value.ToString())
       

    End Sub
End Class

content page's code

Partial Class home
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Page.IsPostBack Then
            TextBox1.Text = Session("menu")
        End If

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Response.Redirect("Default.aspx")
    End Sub
End Class

and i am not getting the selected value in text box becouse while i am clicking on the menu strip is available on master page which loads after content page hence the text box of content page load first and then after the value inserted into session variable if i do refresh page then it will show the value in text box
so please anybody knows solution please help me 
i want to show the the value after immidiate click on menu strip
3
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by hirenpatel53
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.