|
Hello Is there a way to retrieve text from datalist
thanks alot
|
|
|
|
|
|
Thanks for the answer but I mean the text inserted without any control..
Thanks.
|
|
|
|
|
You can't insert text without a control. What DataList are you talking about?
only two letters away from being an asset
|
|
|
|
|
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(" ");
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
|
|
|
|
|
My answer may/may not be dirty, but that would work.
1. Place a Server-Side HiddenField in the *.aspx file.
2. Handle the OnClientClick event (JavaScript) of the Button.
3. OnClientClick you have to set the page number or whatever data you want into the HiddenField.
4. After the OnClientClick event, Button's Click process will start.
5. Now in your Page_PreInit get the values of the HiddenField and continue your routine process.
6. Here you can get rid of Session object.
Let me know if you have questions. Please mark it as answer if it helps you.
|
|
|
|
|
I marked it Thanks alot.
|
|
|
|
|
Hello,
When I add a TemplateField to GridView it is alwasy my first field by default.
How can I change the order?
|
|
|
|
|
|
I have used the following code for reading word document. But it reads only text data and not displaying the images in the word document.
string docname = dr["docname"].ToString();
string path= Server.MapPath("festival_doc");
string m = path + "//"+docname;
Word.ApplicationClass wordapp = new Word.ApplicationClass();
object file = m;
object nullobj = System.Reflection.Missing.Value;
Word.Document doc1 = wordapp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
TextBox1.Text = doc1.Content.Text;
doc1.Close(ref nullobj, ref nullobj, ref nullobj);
regards, Rajesh
|
|
|
|
|
Your last message is just a message below this on the same page and still you reposted it.
This is very RUDE.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Rather than posting a new thread, you should replyed it on my question.
|
|
|
|
|
I have used the following code for reading word document. But it reads only text data and not displaying the images in the word document.
string docname = dr["docname"].ToString();
string path= Server.MapPath("festival_doc");
string m = path + "//"+docname;
Word.ApplicationClass wordapp = new Word.ApplicationClass();
object file = m;
object nullobj = System.Reflection.Missing.Value;
Word.Document doc1 = wordapp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
TextBox1.Text = doc1.Content.Text;
doc1.Close(ref nullobj, ref nullobj, ref nullobj);
regards, Rajesh
|
|
|
|
|
I have table name news in that there is one date,heading field
for example :
column Name:
date newheading
07/08/2009 newsheading1
07/08/2009 newsheading1
07/08/2009 newsheading2
06/08/2009 newsheading106
06/08/2009 newsheading206
I need the output like this
07/08/2009
newsheading1
newsheading1
06/08/2009
newsheading106
newsheading206
For your reference see this url
http://www.indiainfoline.com/stocks/innersection.asp?lmn=2&cat=1
I need the output similar to the above url
|
|
|
|
|
Then, what is your problem ? did you tried it using Repeater Control ? Another approch that you can use, that is using, XSLT.
|
|
|
|
|
Simply proceed with repeater control. In its item template put some HTML table and then fill its cells with desired information just by putting inline aspx tags.
|
|
|
|
|
You alreayd know that you have to use grid or repeater. I can suggest you another approach of trying out several news controls available in the market (like DevExpress[^], ASPAlliance[^], some opensource[^] etc.).
These were few examples which you can find out after Googling..Enjoy
|
|
|
|
|
Just use ListView or Repeater and make your own html.
User ItemTemplate to render your html.
|
|
|
|
|
I am using streams to read data from a word document and display it in a web page. But the output displays only texts and not displaying images in the word document.
Can any one help me.....
Regards,
Rajesh
|
|
|
|
|
How you are reading the content from Word file ? And how displaying it in page ?
|
|
|
|
|
Can any one help me out in using the ajax slide show extender
how to write the webservice method
modified on Saturday, August 8, 2009 7:11 AM
|
|
|
|
|
4anusha4 wrote: Can any one help me out in using the ajax slide show extender
how to write the webservice method
Here is one simple example of it,
AJAX SlideShowExtender Control [^]
Hope this will help you
|
|
|
|
|
I got an error
Microsoft JScript runtime error: Sys.InvalidOperationException: Can't add a handler for the error event using this method. Please set the window.onerror property instead.
could u solve this
|
|
|
|
|
|
thank u
any way i got it i replaced the dll file with the latest version
|
|
|
|