Wednesday, October 12, 2011

Unable to connect the ASP.NET development server / Error of WebDev.WebServer.EXE

Sometimes when you run the asp.net project then suddenly you will get error like

WebDev.WebServer.EXE Error or 


Unable to connect the ASP.NET development server / Error of WebDev.WebServer.EXE


I had search a lot for this error as i found all the solutions for Unable to connect the ASP.NET development server

but i was not getting because of  WebDev.WebServer.EXE & which was corrupted.
Follow the steps if you find the same error & Enjoy!!!!!!!


whenever we debug our project  (either by pressing ctrl+f5 or only f5) the projetcname.exe which is called by VS2008 is called   WebDev.WebServer.EXE which got corrupted may be n number of reasons

1)      go location C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0
        You will find this file
2)      download WebDev.WebServer.rar file from
        http://www.2shared.com/file/11532086/a7f9858a/WebDevWebServer.html
3)      NOTE :  You will need password for extraction this downloaded .rar file
        Password : optimusprime
4)     Copy the downloaded WebDev.WebServer.EXE  file and replace in http://www.2shared.com/file/11532086/a7f9858a/WebDevWebServer.html


AND THE PROBLEM IS SOLVED NOW!!!!!!!!

Friday, October 7, 2011

Textbox EnableViewstate = false property


What are the effects of Textbox EnableViewstate = false property


EnableViewstate property for textbox,dropdownlist controls doesn't effect anything
even though EnableViewstate is false or true.
if this is the case why Enableviewstate property exists for those controls?
No, not exactly. ViewState save any programmatic changes of textbox. For instance, you set textbox value


this.TextBox1.Text = "somevalue"

in a button click event. After postback this value will be saved in Save ViewState event method. When other submit or postback happend. ASP.NET will check the ViewState to load "somevalue" to textbox text property again. which this value is set in pervious visit(click the button).
More information. please check the paragraph #The Role of View State of Understanding ViewState article:

Thursday, October 6, 2011

Missing partial modifier on declaration of type; another partial declaration of this type exists

ERROR:-
I had below codes, but prompt me an error...

namespace FindUserGroup
{
public class ViewUser : System.Web.UI.WebControls.WebParts.WebPart
{
public ViewUser() { }
protected TextBox txtName;
protected Button btnSearch;
protected GridView gvFindGroup;

void btnSearch_Click(object sender, EventArgs e)
{............

By default, C# will give me:

"public partial class ViewUser : System.Web.UI.Page",
when i change it to:  "public class ViewUser : System.Web.UI.WebControls.WebParts.WebPart", it prompts me an error of "Missing partial modifier on declaration of type........, another partial declaration of this type exists".

SOLUTIONS:-
Do you have Usercontrols/Web Pages(C#) migrated from previous version of VS (2003 to 2005)?
It does creates ".aspx.designer.cs" files for you... and the classes are declared in that file too... with
"public partial class"..

In my case I have to add (or make sure) the partial word  in between public and class on all those pages/user conrtols...

I hope it will help somebody who is having the similar issues...

Tuesday, October 4, 2011

Caching works with Web Services.....


DO YOU KNOW CACHING WORKS WITH A WEBSERVICE.....

using System.Web.Caching;

...

HttpContext.Current.Cache[key] == "some value";
string value = HttpContext.Current.Cache[key].ToString();

(500) Errors while uploading the files to FTP using c#.

(500) Syntax error, command unrecognized.


FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftppath);request.UsePassive=
false;


UsePassive: Specifies whether to use either active or passive mode. Earlier, active FTP worked fine with all clients, but now, as most of the random ports are blocked by a firewall, the active mode may fail. 



The passive FTP is helpful in this case. But still, it causes issues at the server. 


The higher ports requested by client on server may also be blocked by a firewall. But, because FTP servers will need to make their servers accessible to the greatest number of clients, they will almost certainly need to support passive FTP. 


Passive mode is considered safe because it ensures all data flow initiation comes from inside (client) the network rather than from the outside (server).

(503) Errors while uploading the files to FTP using c#.

(503) Bad sequence of commands.

I ran into this problem too, also when downloading a number of files. During the operation, the FTP QUIT command was never being issued, so a subsequent attempt to log onto and fetch a file reused the same connection, on which the user was still logged in. The underlying error was not "503 Bad sequence of commands" but "503 You are already logged in!".


So you could modify your code to reuse the existing connection to download subsequent files, or add 


FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftppath);


request.KeepAlive=False 


to the web request, and it will force the FTP QUIT command to be issued when you close it.