Showing posts with label studio. Show all posts
Showing posts with label studio. Show all posts

Saturday, March 31, 2012

Trimming spaces with calendar picker to send to sql statement

I have a Calendar PIcker that we choose a date from and send that out as a parameter to a sql statement. I have created my page in the visual studio designer and what I want to do is send is

RTrim(Calendar1.SelectedDate.ToShortDateString). My problem is since this was created in designer the code is all hidden. I can't place the RTrim() anywhere to accomplish this. Or maybe this whole process needs to be hard coded. It seems to me in VS 2003 you would see all the code thru expanding regions.

Thanks

Hey,

It should be there in the regions; I don't know how you are doing this; if you place it as an expression in the page, it could be in the page HTML. But how are you doing this? I need a little more info...

Wednesday, March 28, 2012

Trouble accesing IIS 5.1

Hiya,

I am trying to open a new ASP.NET Web Application Project using Visual Studio .NET, but it is denied with the following error:

Web Server reported the following error when attempting to create or open the Web Project located at the following URL : "http://localhost/WebApplication1"
'HTTP/1.1 403 Access Forbidden'

I installed everything correctly, first IIS 5.1, then Visual Studio .NET with the update of ASP.NET to 1.1. The error was there even before the update, so I don't think that might be a cause for this problem.

Would appreciate your help guys, as I have to submit the project soon, and really need to get going. Thanks ever so much.To fix IIS mappings for ASP.NET, follow these steps:

1. Click Start -> run -> cmd - ENTER
2. At the command prompt, type the following, and then press ENTER:
"%windir%\Microsoft.NET\Framework\version\aspnet_regiis.exe" -i

In this path, version represents the version number of the .NET Framework that you installed on your server. You need to replace with the actual version number when you type the command.

3. Register the Aspnet_isapi.dll by clicking start -> run
4. In the Open text box, type "regsvr32 %windir%\Microsoft.NET\Framework\version\aspnet_isapi.dll" and then press ENTER
I have re-installed everything, first IIS 5.1, then Visual Studio .NET. Now, it is coming up with the "HTTP/1.1 500 Sever Error"

My initial problem was solved when I followed advice posted below:

http://weblogs.asp.net/jblizzard/archive/2003/07/28/10623.aspx

When I tried to run commands you provided, it returned an error, saying The command is not specified. I suspect it might be because I put 1.1 instead of version in that command. Probably it is not just 1.1 but the full version, which I don't know. Could you advice.

Thanks once again for your kind help.

Saturday, March 24, 2012

Trouble viewing ASP buttons on a web form

Hi,

I am a long-time java programmer, trying to learn about ASP.NET. I am trying write a simple "Hello, Browser" web form using the Visual Studio .NET web form designer. The form consists of a web form label and 3 web form buttons. The buttons don't perform any function. However, when I build and run the program, a browser pops up, but only displays the label and not the buttons. Can anyone tell me what the problem might be? Is it a problem with the code, or maybe some settings?

Thank YouCan you post your code?
If you installed IIS after Visual Studio .NET, you have to register ASP.NET with IIS. You can do this by opening a VS.NET command prompt (i.e. Start > Programs > Visual Studio .NET > Tools > Command Prompt) and typing:

aspnet_regiis -i

That should do the trick. ;)
Super!

This forum is such an amazing resource. I would have never guessed that on my own. Stanley Tan, your solution worked.

Thank you. Thank You. Thank You.

Trouble when creating new ASP .NET Web Project in Visual Studio .NET 2003

Hi all, my name is Ivan and I'm sort of newbie in ASP .NET

I installed Visual Studio .NET 2003, and also IIS 5.1 on OS XP Professional SP2.

I created and developed some great windows applications in Studio, but when I tried to do the same while creating new ASP .NET Project and New Web Project I received an error HTTP:1.1 500 Internal Server Error


Help me out, please

Hi did u check whether your IIS is running?

also try to browse ur page from IIS MMC...

also check whether you are getting any entries in your event log when u get this error


Thanks for the reply.

1. My IIS is running, of course.

2. I named my asp web project as "NewASPProj" and it is in C:\InetPub\wwwroot directory on my system.

I tested it with opening my IE and typed URL: http://localhost

It opened two asp pages IIS start and IIShelp.

3. As for the messages in event log I'll post it on a forum in a few days


Hi Ivan,

Based on my understanding, when you wanted to create the asp.net 1.x application with Visual Studio 2003, you got the error message above. If I have misunderstood you, please feel free to let me know.

The error message "HTTP:1.1 500 Internal Server Error" indicates that your server encounter an unexpected condition which prevented it from fulfilling the request.

Please make sure that the IIS works correctly. We can execute the iisreset at the command prompt to reset the IIS's setting. Besides, we should configure your asp.net 1.x application properly on the IIS.

For more information, seehttp://support.microsoft.com/kb/822319.

I hope this helps.

Thursday, March 22, 2012

Trouble with Response.Cookies

In Visual Studio.NET, I can't get the following code to compile:


public static bool setCookie(string cookiename, string cookievalue)
{
try
{
HttpCookie objCookie = new HttpCookie(cookiename);
Response.Cookies.Add(objCookie);
objCookie.Values.Add(cookiename,cookievalue);
}
catch( Exception e)
{
return false;
}
return true;
}

Visual Studio returns the following build error:

'System.Web.UI.Page.Response' denotes a 'property' where a 'class' was expected.

Any advice would be appreciated.

DougNot sure what the problem is. Have a feeling it is because you have to set the cookie's value before adding it.

As MS put it:
HttpCookie MyCookie = new HttpCookie("LastVisit");
DateTime now = DateTime.Now;

MyCookie.Value = now.ToString();
MyCookie.Expires = now.AddHours(1);

Response.Cookies.Add(MyCookie);

Have a look atthis for examples

HTH

Jagdip
Okay I tried rearranging the code per the suggestion, but still get the same error. Here's the updated code:


public static bool setCookie(string cookiename, string cookievalue)
{
try
{
HttpCookie objCookie = new HttpCookie(cookiename);
objCookie.Value = cookievalue;
Response.Cookies.Add(objCookie);

}
catch( Exception e)
{
return false;
}
return true;
}


try this:
httpcontext.current.response.cookies.add(objcookie)

Tuesday, March 13, 2012

Troubleshooting ASP.NET

when i turn on visual studio.net i got , asp.net project i got thr following message
The specified server is not runnung ASP.NET ...version...
using help i did aspnet_regiis/i
but it does not work

please help
thanks.Well is it saying you are not running ASP.NET version 1.1?

If so make sure you go to C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 in the cmd window and run aspnet_regiis.exe -i . That will install version 1.1.