Wednesday, 8 August 2012

How to hide submit button and Show ID.

I've answered : http://forums.asp.net/t/1799649.aspx/1?how+to+hide+submit+button+and+show+Id+instead+of+that

Question : once click on submit button page have to redirect to page 2.//which i already did
and when user click on back button, that submit button have to hidden and there user can see the Id (number with hyperlink) //how to do this??????
aftre click on that Id user can see again page 2 with that id on querystring.
Answer:
For Example:
Concentrate on the scenario..
1st Page: you have 1Label visible false, 1Submitbutton, 1Hyperlink visible false.
and 2nd page (what ever u wanna put)
on 1stPage. Submitbutton click event
write code :
Session["submit"] = "submit";
Session.Timeout = 5; // 5min.
Response.Redirect("2ndPage.aspx");
its simple u have Redirected to another Page with session.
Now,
on the PAGELoad of 1stPage.aspx.cs
write this code


Respone.Redirect("1stPage.aspx");
if (Session["submit"] != null)
        {
            Label.Text = "ID"; // Bind This ID if you want.
            Label.visible = true;
            HyperLink.visible = true;  // if User has Clicked on SubmitButton so he will get the Session of Submit if there will be Session like "submit" so User will View these Controlls
            Bind this Hyperlink.
        }
        else
        {
            Hyperlink.visible = false;
            Label.visible = false; // its means that if user will not click Submitbutton he will not see these Controls
            
        }
Good Luck`

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More