1

Here is the scenario:

I have 1 master page and web-forms in that master page, All these forms are considered as Modules. Now each module will have sub menus in it.

e.g main.master

abc.aspx, xyz.aspx, uvw.aspx

sub menu of abc.aspx will be like this abc.aspx?p=video, abc.aspx?p=hom etc...

I want to load the data of ?p=home in a content div of abc.aspx or others

How to do this...

What i have done is created a function which check Request["p"]'s value, now do i have to add custom control? if yes then how to?


if you can't understand what i say, i want to load data in a specific div depending on query string.

Ahmed
  • 104
  • 1
  • 1
  • 10
  • [yes & no] - both are correct answers. Your question is not help, you can do anything, but I can not understand what you asking for. – Aristos Jan 30 '12 at 12:49

2 Answers2

1

you can set your div tag to like this first

<div id="someid" runat="server">
 some content
</div> 


if(Reqest["p"]!=null && Request["p"].ToString()=="yourValue")
{
  someid.Visible=True;   
}
Ravi Gadag
  • 15,735
  • 5
  • 57
  • 83
0

No rather check for

Request.QueryString["p"]

Update: You can Use GridView and bind it to an SqlDataSource. Set SelectCommand property of the SqlDataSource control at runtime with different statements. Something like this:

if (!IsPostBack)
{
  if(Request.QueryString["p"] =="contacts")
    SqlDataSource.SelectCommand="Select * from contacts";
   else if(Request.QueryString["p"]=="Activities")
    SqlDataSource.SelectCommand="Select * from Activities";
   ....
 }

Assuming you've passed p=xx from all pages

Mubarek
  • 2,691
  • 1
  • 15
  • 24
  • The div will contain a gridView which will load information of Accounts, Contacts or Activities from database tables. for example - ?p=acc, p=con , p=act ... Can i use one GridView and bind on run time? what should be logic or flow – Ahmed Jan 30 '12 at 13:21
  • So as my application is N-Tier, i have to call a specific function from Business logic that returns result? – Ahmed Jan 30 '12 at 15:05
  • In that case you can use different functions for different tables. After each `if codition` you call the relevant function and bind it to the gridView. I think I'm clear – Mubarek Jan 30 '12 at 15:26