|
how do you find out which button is clicked among many in a page?or what code should you write in page_Load method to find out which button was clicked?
|
|
|
|
|
You may use CommandName property of the Button Server control. Each Button has the unique Command Name. Ok.
Then in Page_Load event, u may check for the Particular button using e.CommandName property.
for ex, if(e.CommandName == "btn1")
Hope it works fine with u.
Regards,
Jay
|
|
|
|
|
Thank You Jay. That was really helpful.i have another question...if there are nN number of buttons in a datagrid and u want 2 know which button was clicked then what do u do?
|
|
|
|
|
i am lost. i am using asp.net 1.1 with c#.
how can i call a funtion from c# using enter.
can someone point me to the right direction?
i can call javascript but how about a function from c#.
tnx.
|
|
|
|
|
You have to make a request to the server. Either by doing a postback, or using AJAX.
---
b { font-weight: normal; }
|
|
|
|
|
I use DropDownList edit DataGrid data, There have 4 columns using DropDownList for edit data. Generally I only want to change one column data. But when I enter editing mode, the all DropDownList’s index change to zero, only I want to change one column! How I set all DropDownList Index default to right value.
|
|
|
|
|
I am not sure whether i have understood the problem correctly but if you want to set some value of the dropdownlist control as selected then this you can do in OnItemDataBound event of the datagrid.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks for your help.
I just want to set a default dropdownlist selectedindex,not use the default zero.
I tried in OnItemDataBound event at edit mode ,but I can't get dropdownlist control.Could you give me more tips?
thank you
|
|
|
|
|
In that event first you have to check for the edit mode and then you have to find the control by the ID you have given and once you find the control you can set the selected item in that. Hope this makes things a bit clear.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Ok,Thank you.I will try this way right now.
|
|
|
|
|
always welcome..
Best Regards,
Apurva Kaushal
|
|
|
|
|
My website has a listing of pdf files that clients can access by opening them in the browser or saving them to their hard drive and then opening it.
Now they want to be able to print the pdf files altogether at one time through the website. How can I print multiple pdf files at the same time or one after the other without any user interaction in asp.net 2.0?
I have thought of merging all the pdf files in to one pdf file and then displaying it in-browser where the user can then hit the print button and print in essence all the documents at once but this approach is not feasible because if the number of pdf documents is too high or if the individual pdf files are too large in size, the server will hang and the session might time out plus there are IO exceptions to consider, etc, etc.
I would appreciate any help or advice. Thanks.
|
|
|
|
|
hi,
are you creating a pdf file using asp.net,c# . i am asking u this question because i have a one api which create pdf file through coding so u can take print out of whole pdf file. if u are fine with this i will send u the api.
cheers....
|
|
|
|
|
Hi,
no i am not creating the pdf files, but if you can send me the api anyways i will appreciate it. thanks. just pm me and i'll give you my email address.
|
|
|
|
|
Greetings all,
I have a DetailsView, and it works fine when it comes to displaying my details. I am databinding the DetailsView to a DataTable that I am building by combining parts of the MembershipUser and the Profile objects. Now my problem is that when I edit the information and tell the DetailsView to Update I have no idea how to actually retrieve programatically what the new values for the fields in the DetailsView are. The Event Arguments of the Update command contains a NewValues and OldValues properties but neither of them contains anything after an update. I'm really stuck here. Any Ideas?
Thanks in advance.
--Peter
|
|
|
|
|
I have dataset that I'd like to stream to the browser as an rss feed. The dataset has a method .WriteXML that I can use, and I have an .xslt file to transform the xml to rss, but how I'm not sure how to put it all together to stream the data to the browser as an rss feed.
My google searches yielded little. Does anyone have ideas on how to do this?
|
|
|
|
|
Hi,
In web form application,i add a web reference with name dataset.It is generating the 3 files datasetwebsr.disco,datasetwebsr.discomap,datasetwebsr.wsdl.To see the proxy code In ASP.NET express edition there is no show all files option.How to see proxy code.
Please help me.
Thanks in advance
|
|
|
|
|
Hi,
I created a webservice.It has the one web method it returning Dataset like this:
[WebMethod]
public DataSet getauthors()
{
//string constr = "Data Source=(local);Initial Catalog=pubs;User Id=sa;Password=kalpana321";
//SqlConnection con = new SqlConnection(constr);
string constr=System.Configuration.ConfigurationManager.AppSettings[0];
SqlConnection con = new SqlConnection(constr);
SqlDataAdapter da = new SqlDataAdapter("select au_id,au_lname,address from authors", con);
DataSet ds = new DataSet();
da.Fill(ds, "authors");
return ds;
}
when i test this web service it is working fine i.e giving authors details.
I created a new c# Windows application and added the web reference of this web service.
In the page_load
Service c=new Service();
dataGridView1.DataSource = c.getauthors();
when i run this windows forms,the gridview doesnot displaying the authors details.Blank datagridview is displaying.
Why gridview not displaying data.
Please help me.
Thanks in advance.
|
|
|
|
|
dataGridView1.DataBind() FTW.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi,
Sorry i did a small mistake.i.e DataGridview1.dataSource=ds,Which is wrong.Correct way is
DataGridview1.dataSource=ds.Tables[0];
|
|
|
|
|
DataGridview1.dataSource=ds will work if you have only one table in the dataset.
But DataGridview1.dataSource=ds.Tables[0]; is correct.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi,
Can anyone help me with a problem. I need to display a random image each time a page is loaded. The project is to be created using c# and asp.Net 2.0.
However i need the random image to be displayed from a given directory rather than from url's placed in a database.
If anyone can offer any help i'd really appreciate it. So far ive only managed to find the following code, but this doesnt help as my server does not have the 'FULL' or 'High' trust level required for the server to run this script.
Random r = new Random();<br />
<br />
System.IO.DirectoryInfo d = new System.IO.DirectoryInfo(@"D:\inetpub\communityfoundation\images\leftofpage\");<br />
System.IO.FileInfo[] fi = d.GetFiles();<br />
<br />
int file = r.Next(fi.GetLength(0));<br />
string FIleName = fi[file].FullName;<br />
<br />
Image1.ImageUrl = FIleName;
Thanks!
|
|
|
|
|
That is the code I gave you last time. It is not a script but rather server side C# code. If you put the pictures in a web folder in IIS you should be able to load images from the directory.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Todd,
I know this is code and typed script by mistake.
When i run the code i get an error saying the application doesnt have the correct security level to run this code. Having checked with my hosting company they have confirmed that this is the case, and therefore i can only run code that works at a medium or lower trust level.
Hence ive had to repost to see if you or anyone else can help me work around this.
Thanks.
|
|
|
|
|
Sorry man, the only thing I can think of is to make a webservice and call that from the app or store the images in a database.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|