|
Basically the rows are displayed from a query.
Say I have ten rows and I click on a button in one of the rows, well I need to get one of the column ids from that row. e.g.
Item Code Item Price
df4545 test 12.99 Button
fh9707 test2 14.99 Button
Say I clicked on one of the buttons, how would I get the item_code ID as it is the same row?
thanks
|
|
|
|
|
In GridView you have the ID set
DataKeyNames="ID"
In the aspx.cs you can do:
ImageButton btn = (ImageButton)sender;
GridViewRow row = (GridViewRow)btn.NamingContainer;
if (e.CommandName.Equals("AnnulGrid"))
{
grdReservation.SelectedIndex = row.RowIndex;
Int64 waardeID = Convert.ToInt64(grdReservation.SelectedValue);
grdReservation.SelectedIndex = -1;
}
I convert the SelectedValue (which is available after setting the SelectedIndex) to In64 because my Databasefiled ID is a BigInt
For a DB-field int you can use int/Int32 in your conversion.
The value of a CELL in a GridView can be obtained via:
In Selected Mode:
row.Cells[1].Text
In Edit-mode:
(TextBox)row.Cells[1].Controls[0]).Text
|
|
|
|
|
I developed an ASP.NET web page using as object Crystal Report. I'm using multiview. After the report run, when I clicked Export or move to the next page, the web page goes blank. I tried in different ways to see the report. I have the following code:
protected void Page_Load(object sender, EventArgs e)
{ // Begin Page_Load
if (!Page.IsPostBack)
{ // Begin if
mvwReport.SetActiveView(viewParameterPrompt);
} // End if
} // End Page_Load
To open the report I have the following code:
CrystalReportViewer1.ParameterFieldInfo = myPFs;
CrystalReportViewer1.RefreshReport();
mvwReport.SetActiveView(viewReportOnDemand);
I don't understand why when I click any button of Crystal report the report goes blank. I hope that someone can help me to handle this issue. I appreciate any help or suggestion or idea.
|
|
|
|
|
Your code in the Page_Load should be put in the Page_Init eventhandler
|
|
|
|
|
I wrote the code in Page_Init but the report is still not showing the second page. Also, I have problems to use the toolbar. I need help about this matter. Does someone have an example of the code to load a Crystal Report Object using C# in ASP.NET ? I appreciate the support.
|
|
|
|
|
can you show the code(-behind) of that page?
|
|
|
|
|
Hi all
I am trying to write an application that would generate an ASP.NET page, based on certain defined criteria. Database support will also be needed... Has anybody attempted such a thing? Any pitfalls I should be aware of? All suggestions are welcome.
Thank you in advance
Chandra
|
|
|
|
|
ChandraRam wrote: generate an ASP.NET page
What do you mean by this? Generate the html output, or generate a file with ASP.NET server tags, etc.?
only two letters away from being an asset
|
|
|
|
|
Hi
Thanks for replying...
What I am looking for is to generate the ASP.NET page (aspx file) and also the VB code behind file. Maybe I can use some templates? In the generating application, I will know what controls (like combo boxes, text boxes and check boxes) and how many of each will be needed, as also the database to connect to and the criteria for populating the controls.
I really hope this is feasible
Chandra
|
|
|
|
|
Have a look at ASP.Net Maker- may help you
|
|
|
|
|
Thank you But what I want to do is write my own generator, which will probably not include all of the features in ASP.NET Maker.
|
|
|
|
|
I get the following error message as soon as I run my application. The problem is I get it randomly(not every time I run my app) and if I try to run my application again after couple of hours, it works fine.
***********************************************
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
**********************************************
Can someone please suggest whats wrong. Is it the application or the .Net or IIS?
Thanks
|
|
|
|
|
If it were consistent then it could be .NET. However, since it happens intermittently my guess would be heavy server load or IIS reseting.
only two letters away from being an asset
|
|
|
|
|
In my event log, I see the following error message
It is not possible to run two different versions of ASP.NET in the same IIS process. Please
use the IIS Administration Tool to reconfigure your server to run the application in a
separate process.
But why do I get this error randomly.
|
|
|
|
|
check this article out it might help ya
http://weblogs.asp.net/owscott/archive/2006/01/26/436607.aspx
|
|
|
|
|
I really didnt understand - If you attempt to run multiple versions of the framework at the same time in the same process.
I mean I am just running my app. Is thier something in my code that creates this problem and why only sometimes. Why dont I get this error everytime.
|
|
|
|
|
Now I could be wrong here, but is it possible that your code is intimately looking at both frameworks, what you should do is make sure you havent got two frameworks on your server or a beta of 1
this might help
if not put your error message into google and you will get other people who have had the same problem
|
|
|
|
|
rajitksingh wrote: It is not possible to run two different versions of ASP.NET in the same IIS process
What you can do in this case, is to create a new Application Pool on the IIS and set the ASP.NET version to 2.0 (or whatever you are using).
If multiple ASP.NET applications run in the same Application Pool and they use different version of ASP.NET, then you typically get this error.
Ask not whether it is useful. Ask what it is useful for.
|
|
|
|
|
Please check in IIS that u r Website is Stopped or Start.
If u r having Oracle installed on u r machine then it will not start u r website so for that u have to manually stop all oracle services.and then go to IIS and right click on your virtual directory i.e your website and start,
and if oracle is not installed then go to IIS and right click on your virtual directory i.e your website and start.
|
|
|
|
|
hai friends..
i got a project "intranet email system" in my company.In this project,client can send email& recive email through intranet system.
Can u plz help me to find methods & table also...
send me ur comments.....as soon as possible
thanks
jeffrey
jeffreykhere@gmail.com
|
|
|
|
|
I'm sorry Jeffrey, but I think your best bet is to tell your boss you can't do it. Or you can try to subcontract to rentacoder or something, but that site is mostly Indians who have no idea how to code, and will screw you over.
The purpose of this site is to help people who are trying to write their own code, not to write code for people. Your question, even if you are asking how to write it yourself, is both not the sort of thing we do, and way too high level to get a real answer in a forum reply.
Sending emails is so trivial, I wrote an article for the benefit of people incapable of using google to find out how it's done. You can find a link to that artile in my sig. Recieving mail is more complex, but still a google away, I am sure.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
When the subject line says 'help me' or 'its urgent',Christian usually gets fumed up instead of replying the question ...here he doesn't ...different yardsticks for different people
.....
|
|
|
|
|
Are you trying to tell us you dont have some days where your patience has worn a bit thin, and others where you seem to have an abundance of patience?
|
|
|
|
|
oops..i've never seen abundance of patience in this forum...anyhow it's up to u dude whether u accept it or not..
.....
|
|
|
|
|
It does get annoying when people post questions which basically say "do my work for me" but at the same time some replies on here can be a lil on the 'short' side
|
|
|
|