|
hi all.
i want draw my answer sheet result in a web page.
if there any way to draw it on a portion of page (for example a panel)?
i want to show it in side other information not in a empty page?
sepel
|
|
|
|
|
I am using ItemDataBound event to add a Link button to a column using following code
LinkButton temp = new LinkButton();
temp.Click += new EventHandler(xyz);
temp.ID = e.Item.Cells[i].Text;
temp.CommandArgument = e.Item.Cells[i].Text;
temp.Text = e.Item.Cells[i].Text;
now when page is displayed i see these buttons but when i click on them, page is refreshed but Click event is not raised. how can i see which event control and which event is raised when i am clicking this link.
Regards
Shajeel
|
|
|
|
|
when u click it only page_load raised.
i think that you'r plused event is null or empty.
if u add your event in page load each time there will be right.
sepel
|
|
|
|
|
no its not null, i have a break point int the function but it is not fired.
Regards
Shajeel
|
|
|
|
|
yes it raised but only page load is raised itrace some problem.
i add javascript to my buttons.
i hope u siolve it.
sepel
|
|
|
|
|
but i want to raise event for function xyz. post back is working but my code is in xyz.
Regards
Shajeel
|
|
|
|
|
i am using asp.net1.1 version...,
Using ajax how to pass a form contained values to another page?,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
hi i am trying to retrieve the login name programically in c sharp.net
currently i am using
formauthentication.redirectfromloginpage("username",false);
to login
i tryed to use the login view to retrieve the login name and it appear correct with the username: username
however i need to store the username in an variable for programming reasons any one know how this can be done?
|
|
|
|
|
User.Identity.Name will give you the name of the logged-in user.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
iam getting the data from database into the dataset and this iam assingn to the datatable but the dataset is containing one row with multiple columns how this data to be converted to one datacolumn with multiple data rows
|
|
|
|
|
jagadeeshkumar2106 wrote: the dataset is containing one row with multiple columns
Datasets don't contain rows or columns. Datasets contain tables, and the tables contain rows and columns.
You could perform the transposition in code, creating the output table dynamically by adding the required rows and columns.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi All,
There is the requirement to read Excel file and store data in a datatable for my web project. I am using C# language.
My code is written below
String connString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + excelFile + ";Extended Properties=Excel 8.0;";
objConn = new OleDbConnection(connString);
objConn.Open();
OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM [" + excelSheetName.Trim() + "]", objConn);
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
objAdapter1.SelectCommand = objCmdSelect;
objAdapter1.Fill(dt);
The above code returns data to a data table, but the problem is to read formated Excel sheet. Suppose there is a formula field, it doesn't store the actual value. It stores some different value.
What other method to read the excel file? I am not using COM component of Excel to read as it is a web project. There may be a security problem after deployment.
Thanks in Advance. :
|
|
|
|
|
i have a label control , How i should , make it's alignment to the center.
|
|
|
|
|
u can use CssClass.
sepel
|
|
|
|
|
ThanQ.I found an alternative
style="text-align:center"
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
I am starting work on an web application that has the possibility of morphing into three distinct sites, an intranet, an extranet, and finally a website in the company's dmz. All three sites would access parts of the same database. What I want to do is to develop a central solution that contains all the common class libraries and handles all communication with the database.Then I would build a separate solution for each of the sites.
I have seen a similar scenario at a client I was not part of the development team and I'm not sure where to start, or how I would go about communicating with the central solution from any of the others.
I would really appreciate any pointers to get me started, the names of any books that would help, or any tutorials that deal with something of this scope.
Thanks.
|
|
|
|
|
So, I posted over on the MS as.net forums, but I have to wait for moderator approval for the post to show, and frankly - I'd rather not wait.
I've been googling all over the net and not found an answer that I can completely understand -- heck I'm not even sure I have been googling the right terms.
I need to pass the contents of a DataSet to an ImageButton EventHandler function. The code I have right now errors cuz I believe the standard EventHandler doesn't allow arguments. I found some info on custom EventHandlers, but I don't really understand how to implement them. Here is the pertinenet code:
C# Script tag code:
<br />
public void exportClick(DataSet dat)<br />
{ <br />
DataTable dt = dat.Tables[0];<br />
DateTime dateStamp = DateTime.Now;<br />
string file = dateStamp.Hour.ToString() + dateStamp.Minute.ToString() + dateStamp.Second.ToString();<br />
CreateCSVFile(dt, Server.MapPath("/csv_export/export"+file+".csv"));<br />
}<br />
sql = "SELECT......";<br />
dat=readDb(sql);<br />
<br />
ImageButton ib = new ImageButton();<br />
ib.ID = "exportButton";<br />
ib.ImageUrl = "./img/export.png";<br />
ib.Width = 110;<br />
ib.Height= 25;<br />
ib.AlternateText="Export to CSV";<br />
ib.Click += new EventHandler(exportClick(dat));<br />
Panel1.Controls.Add(ib);<br />
And the HTML:
<br />
<body><br />
<form runat="server"><br />
......<br />
<asp:panel id="Panel1" runat="server" height="25px" horizontalalign="right" /><br />
......<br />
</form><br />
</body><br />
So ideally what should happen is that the user clicks on ImageButton "ib", which fires the exportClick(dat) function and a CSV file is created from the DataSet "dat". If I can get this working, I have code to fire a file download of the CSV that will get stuffed in as well, but I deal with that once I have a CSV.
Thanks in advance!
modified on Friday, January 11, 2008 4:10:00 PM
|
|
|
|
|
I'm not sure I agree with the logic of your approach. Wouldn't it be better to build the CSV file after the user has clicked the 'Export' button? After all, if the user doesn't click the button then the effort of fetching the data and building the file has been wasted. I would create the file when the user chooses to export the data and stream the data back directly from memory. This cuts out the overhead of having to write to the file system.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Not sure I understand -- the CSV (hopefully) doesn't get created until the user triggers the "onclick" event that triggers my exportClick(DataSet) function -- question is how do I get there?
|
|
|
|
|
Sorry, I misread your code. It still seems unnecessary to fetch the data before the user clicks 'Export' though. IMHO, it would be better to fetch the data and stream it back to the browser only when the user clicks the button. Otherwise you need to persist your dataset between page requests. This adds complexity to your application and may be inefficient if the user never elects to download the file. If you followed my approach, you wouldn't have the EventHandler problem.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Well, there's a lot more going on in this ASPX -- actually the user has already clicked one button to show the data fetched by the SELECT. The purpose of the "Export" button is to allow the user to download an exported CSV of the data he happens to be looking at in his browser .... but Thanks!
|
|
|
|
|
Listen to pmarfleet. Try to learn something from this experience as there are important concepts at the heart of this thread that you seriously need to understand.
Also delete your post from the C# forum.
|
|
|
|
|
All due respect ... I understand what he is saying and he would be absolutely right -- I'd be crazy to go get the data until I need it. However he doesn't have all the facts of what my entire application already does. The data fetch in question is embedded in a function that gets fired based on a previous postback. This function fetches the data based on what the user has requested, then stuffs an export button (which we are dealing with now) and a printable page button (already sorted and working great) onto the page along with a display of the fetched data ...
It looks basically like this:
http://img143.imageshack.us/img143/5783/screencapmr1.png
Now, please -- can someone help with my question -- I keep reading something about Delegates and Custom Event handlers -- does this ring a bell for anyone?
(Deleted other post, so much for throwing a wide net ...)
modified on Friday, January 11, 2008 5:40:53 PM
|
|
|
|
|
The point I was trying to make previously was that your approach was unnecessarily complicated and probably suboptimal for the task at hand. From your screenshot, it looks like you are working with small, simple sets of tabular data. Is it a major performance issue if the data is fetched from the database again if the user selects 'export'? If you were adamant that the data should only be fetched once, you could look at Data Caching[^]. However you should read the documentation and understand its pros and cons if you are considering using it. I think the data requirements your page has are too temporary to consider caching, but it's your choice.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hmmm ... yes the sets of data are typically small and simple -- generally not more than 100 rows of a single table. Lets assume I have the event handling function go get the data again. What would be the best method to have the EventHandler know what to get? I still think I'm stuck cuz it would be silly(and probably wouldn't work anyway) to pass the SQL select string in a query string right? Ugh, I guess I could store the SQL string in a cookie -- but that can't be a security best practice ....
Based on your recommendations I'm playing with some other ideas -- what about storing the dataset in the ViewState?
|
|
|
|