views:

1110

answers:

3

Ok I need to do this. I need to have button on master page. Once that button is clicked I generate string that represents URL.

test.apx is content page I use and the string will look like something like this:

Example: "www.blah.com/test.aspx?user=blax&develop=extreme_all"

Now all I need is to reload the page while content is redirected to the URL i generated.

I hope this makes more sense.

Thanks guys I am new to asp.net and really appreciate any help

A: 

Why dont you use Update Panel?

Shoban
as I said i am new with this so I tried going this way (i explained)I will read your suggestion now it looks promising
grobartn
panel doesnt seem what I need. Because I need just to re-direct to another content page using URL for it.
grobartn
A: 

Have the page postback with the updated query string to change what is in your content area

Assuming your masterpage is set up correctly

within the <asp:content> tag of your aspx page that is using the masterpage you created add code to get the query string

Request.QueryString["key"]

example url: http://www.whatever.com?foo=bar&amp;bar=foo

string tmp = Request.QueryString["foo"]

tmp will become "bar"

Now just check the "postback" option of the asp:control you're using to reload the content page or do whatever you to make the page refresh.

Jonathan Mayhak
thats the idea but HOW to do that some code sample
grobartn
A: 

If I understand your question correctly, you want to reuse the same code to parse out your user and develop variables from different content pages that use the same master page.

It sounds like you need a strongly typed master page.

First, put your shared code in your master page. Then, expose the parsed data as properties of the master page. Next, simply add the following directive in your content pages:

<%@ MasterType VirtualPath="~/mymasterpage.master"  %>

Finally, in your content pages, you can reference your properties as such (assuming you created a property called MyUser):

string user = this.Master.MyUser;

You can also use inheritance if you want a different approach. Simply create class that inherits from Page. Then put your shared code in that class. Finally, make your content pages inherit from your new class, instead of Page.

Aaron Daniels
I want something ( I would think is simple but somehow i wasted whole day trying to find solution so it might not be that simple)...All i need is to mimic redirection but redirection of content page.If you add sitemap file when add that control when you click it will open url specified in file. I want to do that.If button DOIT on master page is clicked i want to reload page with content page being reloaded with URL generated in master page
grobartn