Click here to Skip to main content
15,897,273 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Session variable need to access from aspx page Pin
JJB200716-Nov-07 3:19
JJB200716-Nov-07 3:19 
GeneralRe: Session variable need to access from aspx page Pin
SABhatti16-Nov-07 18:04
SABhatti16-Nov-07 18:04 
AnswerRe: Session variable need to access from aspx page Pin
Guffa15-Nov-07 10:22
Guffa15-Nov-07 10:22 
QuestionMenu navigation trail feature Pin
neualex15-Nov-07 6:50
neualex15-Nov-07 6:50 
AnswerRe: Menu navigation trail feature Pin
SABhatti15-Nov-07 10:33
SABhatti15-Nov-07 10:33 
GeneralRe: Menu navigation trail feature Pin
neualex15-Nov-07 12:03
neualex15-Nov-07 12:03 
AnswerRe: Menu navigation trail feature Pin
Vasudevan Deepak Kumar16-Nov-07 1:28
Vasudevan Deepak Kumar16-Nov-07 1:28 
QuestionCreating a dynamic sql dataset without needing to postback Pin
kosh205915-Nov-07 3:39
kosh205915-Nov-07 3:39 
Hi,

i'm a beginner in asp.net programming and web for that matter,
and in need of some help.

i use an unknown amout of tables that i need to view, lets assume the connection string and select query are entered by the user.

i need in the page_load or somewhere to create a dataset and set the gridview to it. the grid view is a static control on the web form.

now i am using:

protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("con str");
SqlDataAdapter ad = new SqlDataAdapter("select str", con);
DataSet ds = new DataSet();
ad.Fill(ds, "test");
con.Close();

this.Controls.Add(data);
theGrid.DataSourceID = data.ID;
theGrid.DataSource = ds;
theGrid.DataBind();
}

this works, but each click/change that causes a postback will call page_loaf again. i tried to define the ds variable as private var of the class, and then put the 3 first lines in an if (!postback) {...} statment.
didn't work, the vars are recreated on each post back.

what is the solution for this?
how can i create a grid that will be saved without re binding it?
(and if i don't add the ds to the form as a control, it just doesn't bind)

help!!!

thanks, koren.


kosh2059


kosh2059

AnswerRe: Creating a dynamic sql dataset without needing to postback Pin
Colin Angus Mackay15-Nov-07 4:06
Colin Angus Mackay15-Nov-07 4:06 
QuestionLocation displaying in popup Pin
rosswyld14-Nov-07 21:20
rosswyld14-Nov-07 21:20 
AnswerRe: Location displaying in popup Pin
SABhatti15-Nov-07 10:26
SABhatti15-Nov-07 10:26 
Questionxml page in iframe Pin
srinivas43114-Nov-07 19:28
srinivas43114-Nov-07 19:28 
AnswerRe: xml page in iframe Pin
Christian Graus14-Nov-07 20:25
protectorChristian Graus14-Nov-07 20:25 
Questiondividing the data and going to next page Pin
srinivas43114-Nov-07 18:18
srinivas43114-Nov-07 18:18 
AnswerRe: dividing the data and going to next page Pin
Tamimi - Code14-Nov-07 20:15
Tamimi - Code14-Nov-07 20:15 
AnswerRe: dividing the data and going to next page Pin
Christian Graus14-Nov-07 20:27
protectorChristian Graus14-Nov-07 20:27 
QuestionSimple problem... I think with page error Pin
No-e14-Nov-07 8:30
No-e14-Nov-07 8:30 
AnswerRe: Simple problem... I think with page error Pin
Hesham Amin15-Nov-07 10:46
Hesham Amin15-Nov-07 10:46 
QuestionHELP: IE7 pop-up blocker bypass Pin
andrewwan198014-Nov-07 4:42
andrewwan198014-Nov-07 4:42 
AnswerRe: HELP: IE7 pop-up blocker bypass Pin
andrewwan198014-Nov-07 5:18
andrewwan198014-Nov-07 5:18 
AnswerRe: HELP: IE7 pop-up blocker bypass Pin
Vasudevan Deepak Kumar14-Nov-07 19:32
Vasudevan Deepak Kumar14-Nov-07 19:32 
QuestionSize of a Web Service Request Pin
Ferudun Atakan13-Nov-07 22:29
Ferudun Atakan13-Nov-07 22:29 
Questionajax control not working properly Pin
Parvai13-Nov-07 19:18
Parvai13-Nov-07 19:18 
AnswerRe: ajax control not working properly Pin
Christian Graus13-Nov-07 19:54
protectorChristian Graus13-Nov-07 19:54 
AnswerRe: images in xml Pin
Christian Graus13-Nov-07 18:57
protectorChristian Graus13-Nov-07 18:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.