|
Wow, that's a lot to take in.
There appears to be a version difference, so I'm having some difficulty finding all of the screens shown in the example.
Let me start with what you have written,
<br />
1. Published your web application from VS.<br />
Can I use the files which result from a "build" instead of a "publish"?
<br />
2. Copy the published folder in C:\initpub\wwwroot<br />
Do you mean copy the published folder into the preexisting C:\inetpub\wwwroot file (I assume yes) or to create a new path called C:\initpub\wwwroot
also, should I paste in just the contents of the program folder, or include the folder which wraps the files?
__
I guess there is a version difference, because I'm getting hung on
<br />
6. Right Click on that Folder > Properties<br />
7. In Defult Tab, There is a Create Button. Click on It<br />
The problem is there is no Properties option when I right click. In fact I can't find the Properties anywhere (normally this would be at the bottom of list upon right click). If I could find this functionality somewhere I would be able to follow along but so far.....
I'll keep working on this.
Jeff
|
|
|
|
|
Jeffrey Webster wrote: 1. Published your web application from VS.
Can I use the files which result from a "build" instead of a "publish"?
Yes. You can
Jeffrey Webster wrote: 2. Copy the published folder in C:\initpub\wwwroot
Do you mean copy the published folder into the preexisting C:\inetpub\wwwroot file (I assume yes) or to create a new path called C:\initpub\wwwroot
No. If you have IIS Installed , then you should have the folder. So copy you build web site over the preexisintg Folder
Jeffrey Webster wrote: I guess there is a version difference, because I'm getting hung on
6. Right Click on that Folder > Properties
7. In Defult Tab, There is a Create Button. Click on It
The problem is there is no Properties option when I right click. In fact I can't find the Properties anywhere (normally this would be at the bottom of list upon right click). If I could find this functionality somewhere I would be able to follow along but so far.....
No need to wories. I guess, you have seen the article on IIS 6.0 . I have also provided you the article of how to deploy web sites on IIS 7.0 .
Deploying web sites on IIS 7.0
Hope this is helpful to you
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
Yes, I followed the other "path" of our exchange and found your info for IIS 7.0 which made much more sense. It's a major UI difference between the two versions!!
I found that "scraping" the build contents gave some strange results, so I included the containing folder and found that the IIS UI seemed to understand what was going on. This is consistent with your reply.
So I've completed all of the steps including the creation of a new application pool and assigning to it the sample website (VS_Website1).
This actually doesn't appear to work, at least not by using http://localhost/VS_Website1 or http:\\localhost\VS_Website1
I get the 500.19 Internal Server Error.
Also, I'm not sure I'm following the basic idea since this all seems to be leading back to hosting it on my own computer which I can already do. How does this relate to getting it onto the external server?
I'll continue to read on in the article and see if I can see the thrust of what you're doing here....
Thanks,
Jeff
|
|
|
|
|
Hi,
As I've looked at the error it does show that at least it is recognizing where the pages should be found. In the error message below you can see that it shows the requested URL and then the location of the folder containing the ASP.NET app, which is correct.
So it's definitely better than the "can't find server at..." error.
It seems to be complaining about configuration data for the page. Unfortunately I don't know much about page configuration data, and a Google search didn't help much. Any ideas what might be ailing it?
<br />
<br />
HTTP Error 500.19 - Internal Server Error<br />
The requested page cannot be accessed because the related configuration data for the page is invalid.<br />
<br />
<br />
Requested URL http:
Physical Path C:\inetpub\wwwroot\VS_Website1<br />
Logon Method Not yet determined<br />
Logon User Not yet determined<br />
<br />
Thanks,
Jeff
|
|
|
|
|
Try to acees usign page name. I guess you didnot set the default page.
if Home.aspx is your default page, then try with
http://localhost:80/VS_Website1/Home.aspx
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I am trying to create a web server with a few wcf services that use ASP's authentication and authorization.
I am using the System.Web.ApplicationServices.AuthenticationService and and implemented it as outlined in MSDN[^]
Though I am catching the AuthenticationService.Authenticating event and successfully authenticating the request, that authentication does not seem to be applied with any other request.
Even subsequent calls to AuthenticationService.IsLoggedIn() return false.
Do I need to attach the authentication cookie to subsequent requests? If so, how does one do that?
Also, can I use the PrincipalPermission attibute on other services I implement to restrict access to methods based on users and roles, or is there someother mechanism to control access?
|
|
|
|
|
Gentleman:
I have posted this issue at several sites and received some very useful code, ranging from 2 lines to a dozen, on how to retrieve row and cell information from a GridView. Thanks to all of you. That being said, the original issue was that I was (am) receiving an "Index Out of Range" exception error. The CommandArgument correctly reports the selected row. This happens regardless of which string of code I am using. Now, I know that only a few developers really understand the stack trace (and I am not one of them), but because I have not been able to understand the reason for the error, I am posting the entire error and stack trace for all to see. I am hopeful that one of you geniuses out there will be able to determine the exact cause of the error. For my part, it appears that the System.Collection array is predetermined by the GridView and is automatically passed along. I cannot understand how or why I can get this error, since there are always a positive number of rows. My entire application has been stopped for a week due to this error. PLEASE.....HELP if you can. All suggestions are greatly appreciated. This is certainly over my head. Thanks in advance to all that have sent in code and especially to person that can finally solve this dilemma......Pat
MY Code:
//Define the row and cell
int theRow = Convert.ToInt32(e.CommandArgument);
int theCell = 5;
//Get the Row information
GridViewRow gvr = (GridViewRow)GridViewResults.Rows[theRow]; //THE ERROR REPORTS ON THIS LINE
//Get the information from the cell
string thePdf = gvr.Cells[theCell].Text;
//Pass the pdf information, start the users Pdf Reader
Process.Start(thePdf);
The Complete Error:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
Line 481:
Line 482: //Get the Row information
Line 483: GridViewRow gvr = (GridViewRow)GridViewResults.Rows[theRow];
Line 484:
Line 485: //Get the information from the cell
Source File: c:\Documents and Settings\Patrick Tuminaro\My Documents\Visual Studio 2008\WebSites\TB_09_Online\Main.aspx.cs Line: 483
Stack Trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.ArrayList.get_Item(Int32 index) +7485640
System.Web.UI.WebControls.GridViewRowCollection.get_Item(Int32 index) +13
Main.GridViewResults_RowCommand(Object sender, GridViewCommandEventArgs e) in c:\Documents and Settings\Patrick Tuminaro\My Documents\Visual Studio 2008\WebSites\TB_09_Online\Main.aspx.cs:483
System.Web.UI.WebControls.GridView.OnRowCommand(GridViewCommandEventArgs e) +108
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +112
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +207
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
|
|
|
|
|
PDTUM wrote: //Get the Row information
GridViewRow gvr = (GridViewRow)GridViewResults.Rows[theRow]; //THE ERROR REPORTS ON THIS LINE
Did you debuged your code? What is the value of theRow ?
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
|
|
|
|
|
Hi Abhijit,
Thank you for your response. The value of [theRow] is whatever the value of the selected row is that triggered the event was. This works correctly, as checked in debug mode. I have now determined that the Rows value is returning "0" rows in the array as determined by GridView.Rows.Count. I do not know why...yet. Any ideas?
|
|
|
|
|
In which event or method you have wrote this code ? Can you please provide some more code on Grid Selection Index changed event. Please post code with proper format.
Thanks.
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
|
|
|
|
|
Abhijit,
Thank you. Please find the complete RowCommand event below. Failure occurs on the gvr Cast.
protected void GridViewResults_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridViewResults.EnableViewState = true;
int count = GridViewResults.Rows.Count;
//Define the row and cell
int theRow = Convert.ToInt32(e.CommandArgument);
int theCell = 5;
//Get the Row information
GridViewRow gvr = (GridViewRow)GridViewResults.Rows[theRow]; ////FAILS...ROWS (Count) reports NULL! WHY?
//Get the information from the cell
string thePdf = gvr.Cells[theCell].Text;
//Pass the pdf information, start the users Pdf Reader
Process.Start(thePdf);
}
}
|
|
|
|
|
PDTUM wrote:
//Define the row and cell
int theRow = Convert.ToInt32(e.CommandArgument);
Does the value of theRow Comming properly ? Where did you set value for CommandArgument ?
PDTUM wrote: //Pass the pdf information, start the users Pdf Reader
Process.Start(thePdf);
What are you doing here? This will not start the pdf reader on client system. It will execute only on server.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi Abhijit,
The e.CommandArguement value for the row is correctly reported, depending on the row that was selected. As for the Pdf, I appreciate your input. I have not gotten far enough yet to see this problem (I just jotted it down without testing it). Please correct as necessary... ...BUT first I need to be able to retrieve the text from the cell. I am sure the error is coming from the Rows value of this line:
GridViewRow gvr = (GridViewRow)GridViewResults.Rows[theRow];
NOT the value of [theRow]. Unfortunately, I am stuck at this point. Thanks again for your help. Any ideas?
|
|
|
|
|
PDTUM wrote: GridViewRow gvr = (GridViewRow)GridViewResults.Rows[theRow];
Simply use
GridViewRow gvr = GridViewResults.Rows[theRow];
Why you are using RowCommand event where as you are not using any Command Name? Why you are not using Selection index changed ?
Please go through the link
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
OK....it seems the gvr will work without the cast (I tried it)....BUT....I was using the RowCommand event to get the number of the selected row so I could pass it in. I suppose I could use both events and pass the row number to a class level variable, but why not do everything at the same time? Either way, the issue is not with the row number, but rather because the NUMBER OF ROWS being reported is NULL according to the GridViewResults.Rows.Count script. If I can determine why this is, I think the problem will be solved. Thanks for your help....I'm still working on it...keep in touch, Pat
|
|
|
|
|
OK Gentleman,
Thank you all. I have found that rows of the GridView were being nullified during postback by a method call on the Page_Load event. For those of you with a similar issue, the final working code regarding how to get row and cell data from a gridview in ASP.NET, here is a perfect and easy solution code using the RowCommand event:
protected void GridViewResults_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridViewResults.EnableViewState = true;
int count = GridViewResults.Rows.Count; //Checks for a positive returned number of rows
//Define the row and cell
int theRow = Convert.ToInt32(e.CommandArgument); //Gets the Row Number
int theCell = 6; //Defines the Cell Row
//Get the Row information
GridViewRow gvr = GridViewResults.Rows[theRow]; //Creates a GridViewRow Object
//Get the information from the cell
string thePdf = gvr.Cells[theCell].Text; // Returns the data from the selected Cell
To all you guys out there....ENJOY.
|
|
|
|
|
PDTUM wrote: I have found that rows of the GridView were being nullified during postback by a method call on the Page_Load event.
This is one of the common mistake done in begining while binding any data with some control. You should take care about Page.IsPostback Property.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Gridview shouldn't bind in postback
so bing your datagrid as follows. This will fix ur problem..
if (!IsPostBack)
{
BindGridView();
}
-Ravi Kakumani
|
|
|
|
|
Ravi,
Thank you for your reply. The solution that I posted in an earlier message is working perfectly in all browsers. I appreciate your input and hope that you will be available to assist me on other issues as they arise.
Best Regards, Pat
|
|
|
|
|
hey im using mscharts im unable to show multiple columns value or the value of one row selected from database one either axis of web chart(either on X aixs or on y axis) .. plz help me buddies really needed urgently..
here is my row eg:
title|2006|2007|2008|2009|
bmat |1.70|8.69|4.67|23.8|
i have installed .net framework 3.5 sp1
and vs addons , mscharts...plz help buddies
any guidence will be appreciated
|
|
|
|
|
|
let me check.. thanks
|
|
|
|
|
hey abhijit its showing some error...
can u guide me a bit more thanks in advance
|
|
|
|
|
What error it is show ? How you are trying to open the application?
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
|
|
|
|
|
now i have done rectification working.... let me look for thing of my purpose...
|
|
|
|