Click here to Skip to main content
15,918,808 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: getting row index of a table in data source Pin
Arindam Sinha9-Aug-09 7:14
Arindam Sinha9-Aug-09 7:14 
QuestionPassing Array to javascript function from asp.net aspx.cs Pin
amarnath n.n9-Aug-09 0:28
amarnath n.n9-Aug-09 0:28 
AnswerRe: Passing Array to javascript function from asp.net aspx.cs Pin
Abhijit Jana9-Aug-09 0:40
professionalAbhijit Jana9-Aug-09 0:40 
Questionretrieving text from datalist Pin
Ersan Ercek8-Aug-09 10:13
Ersan Ercek8-Aug-09 10:13 
AnswerRe: retrieving text from datalist Pin
Abhijit Jana8-Aug-09 10:46
professionalAbhijit Jana8-Aug-09 10:46 
GeneralRe: retrieving text from datalist Pin
Ersan Ercek8-Aug-09 10:51
Ersan Ercek8-Aug-09 10:51 
GeneralRe: retrieving text from datalist Pin
Not Active8-Aug-09 11:07
mentorNot Active8-Aug-09 11:07 
QuestionDynamic Links Pin
Ersan Ercek8-Aug-09 7:59
Ersan Ercek8-Aug-09 7:59 
Dear All,

I have a page holding data in data list. I created paging option for datalist with dynamic link buttons created during-page pre init event. It runs if(!Ispostback).

Then I hold number of pages in session in order not to connect to database in each page refresh.

Then I have dropdown list accorging to which the number of pages changes. So the number of link buttons also should change with selection.

However when I clicked on the button page-preinit creates the link buttons before the it handles click event, therefore creates the link buttons according to the number hold in session, in other words according to previous page number..

Here are the codes

protected void page_Preinit(object sender, EventArgs e)
{
if (!IsPostBack)
{
getpagecount("0","0","0"); // gets the page count form database.
}
else { lb_Count = int.Parse(Session["Page"].ToString()); } //gets the figure in the session.


for (int i = 1; i <= lb_Count; i++)
{
LinkButton bottomLink = new LinkButton();
LiteralControl bottomLiteral = new LiteralControl("&nbsp;");
bottomLink.Text = i.ToString();
pnlBottom.Controls.Add(bottomLink);
pnlBottom.Controls.Add(bottomLiteral);
bottomLink.Click += new EventHandler(this.changeLink);
}

if (con!=null && con.State == ConnectionState.Open)
{
con.Close();
cmd.Dispose();
}
}

HERE IS THE CLICKED EVENT

protected void btnYemekler_Click(object sender, ImageClickEventArgs e)
{
//HERE, THE PAGE NUMBER IN SESSION CHANGES BUT THE LINK BUTTOS ARE ALREADY CREATED.
getpagecount(DlAscilar.SelectedValue.ToString(),
DlMutfaklar.SelectedValue.ToString(), DlBolgeler.SelectedValue.ToString());



doldur(DlAscilar.SelectedValue.ToString(),
DlMutfaklar.SelectedValue.ToString(), DlBolgeler.SelectedValue.ToString());
dlListe_Doldur(0);
}

WHAT CAN I DO TO HANDLE THIS PROBLEM.

THANKS IN ADVANCE
AnswerRe: Dynamic Links Pin
Venkatesh Mookkan9-Aug-09 16:44
Venkatesh Mookkan9-Aug-09 16:44 
GeneralRe: Dynamic Links Pin
Ersan Ercek9-Aug-09 22:20
Ersan Ercek9-Aug-09 22:20 
QuestionChanging TemplateField's order Pin
comp_j8-Aug-09 7:03
comp_j8-Aug-09 7:03 
AnswerRe: Changing TemplateField's order Pin
Abhijit Jana8-Aug-09 8:45
professionalAbhijit Jana8-Aug-09 8:45 
QuestionImage reading problem Pin
rk267928-Aug-09 6:23
rk267928-Aug-09 6:23 
AnswerIgnore Repost Pin
Manas Bhardwaj8-Aug-09 6:29
professionalManas Bhardwaj8-Aug-09 6:29 
AnswerRe: Image reading problem Pin
Abhijit Jana8-Aug-09 8:46
professionalAbhijit Jana8-Aug-09 8:46 
GeneralRe: Image reading problem Pin
rk267929-Aug-09 2:48
rk267929-Aug-09 2:48 
QuestionTo Display news in datewise for every day there will be news only one time the date should come ( in datagrid or repeater) Pin
nandaranipet8-Aug-09 1:14
nandaranipet8-Aug-09 1:14 
AnswerRe: To Display news in datewise for every day there will be news only one time the date should come ( in datagrid or repeater) Pin
Abhijit Jana8-Aug-09 2:26
professionalAbhijit Jana8-Aug-09 2:26 
AnswerRe: To Display news in datewise for every day there will be news only one time the date should come ( in datagrid or repeater) Pin
Muhammad Mazhar8-Aug-09 3:34
Muhammad Mazhar8-Aug-09 3:34 
AnswerRe: To Display news in datewise for every day there will be news only one time the date should come ( in datagrid or repeater) Pin
Arindam Sinha8-Aug-09 5:34
Arindam Sinha8-Aug-09 5:34 
AnswerRe: To Display news in datewise for every day there will be news only one time the date should come ( in datagrid or repeater) Pin
Abhishek Sur8-Aug-09 8:11
professionalAbhishek Sur8-Aug-09 8:11 
QuestionImage reading problem Pin
rk267928-Aug-09 0:05
rk267928-Aug-09 0:05 
AnswerRe: Image reading problem Pin
Abhijit Jana8-Aug-09 2:24
professionalAbhijit Jana8-Aug-09 2:24 
Questionaja slide show [modified] Pin
4anusha47-Aug-09 23:55
4anusha47-Aug-09 23:55 
AnswerRe: aja slide show Pin
Abhijit Jana8-Aug-09 2:11
professionalAbhijit Jana8-Aug-09 2:11 

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.