|
Can you get your simple ASP.NET application to run in the Visual Studio debug environment ?
Try this ...
Select Debug/Start Debugging from the menu. It will start a small web-server on your machine and run the web application there, allowing you to step through code if necessary.
If that works, then you need to setup IIS and deploy your ASP.NET application there.
Do you have a separate server with IIS installed ? or Are you trying to run IIS on your development machine ?
The next topic you may want to investigate is "Installing IIS".
|
|
|
|
|
Hi,
Thanks for your reply.
Okay, it runs fine when viewed on my computer. Basically I'm viewing it in Firefox and the address is listed as
http://localhost:49../FirstWebPage.aspx
This is all well and good, but obviously I want to run it on the server (a separate entity out in the midwest), not on my computer.
I'm very confused about what IIS is or does. One tutorial suggested I needed to enable IIS on my local machine, which I did, but that didn't make the program run any better or worse here (logically). The issue isn't how to make it run here but getting it to run on the server.
How exactly would the server know how to interpret the weird files spit out by ASP.NET? How does it know where to "enter"? Is there some way to tell the server "expect a ASP.NET application"?
I know this is incredibly basic but I find half the problems I encounter in programming are just this kind of thing, getting the first lines of communication started.
Thanks,
Jeff
|
|
|
|
|
Jeffrey Webster wrote: I'm very confused about what IIS is or does.
In simple words, IIS is an web server which used to HOST the ASP.NET web application. In Visual Studio, ASP.NET engined is integrated and its takes care of all the execution. Now for the hosting of the web application we need to deploy the site on IIS.
Jeffrey Webster wrote: One tutorial suggested I needed to enable IIS on my local machine,
Which OS are you using? In recent there are 3 IIS is used. IIS 5.1 (WinXP) , IIS 6.0 ( Win 2k3), IIS 7.0 (Vista Premium, Win Server 2008 )
I gueess you are dealing with Win2k3 and here is the installion guide of IIS 6.0
Installing IIS6
But installtion of rest are also same.
Jeffrey Webster wrote: How exactly would the server know how to interpret the weird files spit out by ASP.NET? How does it know where to "enter"? Is there some way to tell the server "expect a ASP.NET application"?
This is all about How IIS and ASP.NET integrated together, How IIS handels the request, What is the Use Of HTTPHandler and HTTPMoudle.
If am refering you some good links, This will help you
IIS 6 and ASP.NET
IIS 7 and ASP.NET
Hope this will helps you
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,
I'll check out those links in just a second.
Which OS are you using? In recent there are 3 IIS is used. IIS 5.1 (WinXP) , IIS 6.0 ( Win 2k3), IIS 7.0 (Vista Premium, Win Server 2008 )
I'm assuming IIS 7.0 because I'm running Vista.
Also, as I mentioned in the other reply, there appears to be an issue because I'm running the Express version of the Visual Web Developer. I guess it's a Catch 22. I want to know if it is worth ponying up the dough for this thing. But it's hard to determine that if it won't let me upload the app to test.
Jeff
|
|
|
|
|
Jeffrey Webster wrote:
I'm assuming IIS 7.0 because I'm running Vista.
Cool.
Here is my complete Article on Deplying web site on IIS 7
Deploying ASP. Net Websites on IIS 7.0
Regarding Second part, I have already give you the answer
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
modified on Thursday, July 23, 2009 4:40 PM
|
|
|
|
|
If you have developed your web application in VS studio and want to Deploy on server (IIS ) you need to perform the following step.
1. Published your web application from VS.
2. Copy the published folder in C:\initpub\wwwroot
3. Start > Run > inetmgr
4. Click on Default web site
5. You will get the folder of your web application.
6. Right Click on that Folder > Properties
7. In Defult Tab, There is a Create Button . Click on It
8. Goto ASP.NET TAb > Select Proper Framework Version
9. Goto Security Tab > Edit > Select Anonymous
10. Apply > OK
11. Close IIS
12. Open Browser > type http://ipaddress/VirtualDirectoryName/Default.aspx
That's All.
Here is an good Tutorial
Make Sure, IIS is installed in the Server and ASP.NET is registred with IIS.
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,
Okay I see one of the problems I'm having is I'm using the Express edition. I just learned through the MSDN site that you can't publish the website without the full version.
I'm wondering if maybe there is a way to work around this limitation or if it really is impossible to actually use the Express edition in a practical way.
Thanks,
Jeff
|
|
|
|
|
Publishing of web site is something different and you can read some more information from net regrading this. Generaly it is done for security purpose. You can do the same thing with out publishing the web site as you are in learning phase, just copy the web site folder to wwwroot folder.
Please go through the CP article which I have provided to in my last answer.
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,
Okay I'll check that out.
Thanks...
|
|
|
|
|
Let me know if you have any issue. I think I can help you on IIS related you
cheers,
Abhijit
CodeProject MVP
Web Site:abhijitjana.net
When you ask a question, remember to click "Good Answer", If the Answer is helps you.
|
|
|
|
|
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
|
|
|
|