|
The global asax is ok, just remove the reference to label2
In a webform use this code:
LabelName.Text = Application["userCount"].ToString();
Alexei Rodriguez
|
|
|
|
|
Hi,
I have a main page with an update panel and within it a wizard control.
The main page is assigned a Master page in which a script manager resides.
The wizard buttons are implemented as image buttons inside navigation templates and each of the 3 wizard steps is implemented by a dedicated user control.
On each step-control, I have several textboxes and dropdown lists. Some of the controls generate (Async) PostBack to the server.
The wizard navigation also generates AsyncPostBack since the whole wizard is inside the updatepanel.
The application was tested thoroughly and it causes no problems for clients with relatively good connection.
Alas when used by remote clients with slower connection (we assume this is the commonality between those reporting the error), the navigation between pages sometime shows the following error:
"Sys.WebForms.PagerequestManagerServerErrorException: An Unknown error occurred while processing the request on the server. The status code returned from the server was 500"
Please note: error was manifested only for some client, only some times and only in the navigation, not in the inter-step updates.
I have used fiddler and saw that the http response from the server is actually with status 200 but it contains the raw response text is something like "0|error|500||"
I tried to log errors on the ScriptManager.AsyncPostBackError event but it seems not to be called.
Any suggestions???
10x in advanced
|
|
|
|
|
Set ValidateRequest to "false" in your page directive.
Hope this will address your problem.
|
|
|
|
|
No, I am getting the same error even after setting validate =false.
Why this is occuring?
Can anyone please provide me a exact solution to solve this problem permenently?
Thanks in advance.
|
|
|
|
|
Hi,
I have a small form app that imports a image that a user browses to and adds the metadata to that image based on information provided in the form.
The process does work, it just doesn't write the description properties. It writes to the copywrite tag just fine, as well as create and transport the new image between servers.
Any help is always appreciated. The code that is supposed to write the metadata is:
if(this.sErrors == "") {
try {
ASCIIEncoding oEncoder = new ASCIIEncoding();
string sNewFile = Guid.NewGuid().ToString("D")+".jpg";
string sFile = Server.MapPath("tmp\\upload-"+sNewFile);
PropertyItem oProp;
PictureLocation.SaveAs(sFile);
Image imgUpload = Image.FromFile(sFile);
foreach(PropertyItem oProperty in imgUpload.PropertyItems) {
imgUpload.RemovePropertyItem(oProperty.Id);
}
oProp = CreatePropertyItem(0x0320, PictureCaption.Text);
imgUpload.SetPropertyItem(oProp);
oProp = CreatePropertyItem(0x013B, FirstName.Text+" "+LastName.Text+" ("+EMail.Text+")");
imgUpload.SetPropertyItem(oProp);
oProp = CreatePropertyItem(0x8298, Address.Text + ", " + City.Text + ", " + State.Text + " " + ZipCode.Text);
imgUpload.SetPropertyItem(oProp);
oProp = CreatePropertyItem(0x010E, WhatKindOfFun.Value);
imgUpload.SetPropertyItem(oProp);
imgUpload.Save(Server.MapPath("tmp\\process-"+sNewFile));
imgUpload.Dispose();
DateTime oDate = DateTime.Now;
this.CreateFTPDirectory("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/");
this.CreateFTPDirectory("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/"+Convert.ToString(oDate.Month)+"/");
this.CreateFTPDirectory("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/"+Convert.ToString(oDate.Month)+"/"+Convert.ToString(oDate.Day)+"/");
FtpWebRequest oFTP = (FtpWebRequest)FtpWebRequest.Create("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/"+Convert.ToString(oDate.Month)+"/"+Convert.ToString(oDate.Day)+"/"+sNewFile);
oFTP.Method = WebRequestMethods.Ftp.UploadFile;
oFTP.Credentials = this.oCred;
oFTP.UsePassive = true;
oFTP.UseBinary = true;
oFTP.KeepAlive = false;
FileStream oFile = File.OpenRead(Server.MapPath("tmp\\process-"+sNewFile));
byte[] oBuffer = new byte[oFile.Length];
oFile.Read(oBuffer, 0, oBuffer.Length);
oFile.Close();
Stream oStream = oFTP.GetRequestStream();
oStream.Write(oBuffer, 0, oBuffer.Length);
oStream.Close();
Response.Redirect("The site it goes to");
} catch {
}
}
|
|
|
|
|
On the page load event i have coded this:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Attributes.Add("onblur", "return myfunc()")
End Sub
Public Sub myfunc()
Dim dataset1 as new dataset
Dim da as new dataadapter
..
..
TextBox1.Text = "This is lostfocus."
End Sub
but it is not working. In the myfunc() i would like to code connection string, data adapter and dataset to go further.
Kindly tell me how call a function/procedure which is wirtten in file.aspx.vb on lost focus of textbox.
Thanks & Regards
Girish Sharma
|
|
|
|
|
You're trying to call a server side event with client script by the looks of it. Try learning about Ajax.
|
|
|
|
|
Hi, to call function, first the function must be public if you want to use it to other project or webform.
About your Code to call the procedure myfunc()
example in your button1 click event you can insert
button1_click()
{
myfunc();
}
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
use this code:
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
myfunc()
End Sub
Remove the code in you page load and set the textbox autopostback = true
Alexei Rodriguez
|
|
|
|
|
Your solution worked for me.
Thank you Alexei Rodriguez!!!
Regards
Girish Sharma
|
|
|
|
|
Hi,
Iam srikanth a 4 + years .Net developer. I have a Dotnet interview focusing more on asp.net and xml. could anyone plz suggest some important questions on asp.net. mostly what would the project manager would concentrate on real time scenarious. i would be thankfull for the members in this site who give me giudence.
With regards
Srikanth
|
|
|
|
|
|
No one can tell the real time scenarios as these are different for different business rules.
Better divide the question in different categories and concentrate on the basic and technical stuffs
Its not necessary the issues they have faced might also have been faced by you so better to be technically strong
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Just before your interview is the wrong time to learn ASP.NET.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
You are claiming 4+ years of .net. What is your problem then? May be you have not worked on asp.net, which is fine. Then why do you want to memorize asp.net question just for the interview.
Look, I don't know where you are being interview. I have sat down on interview and told them straight face how much I know about particular technology and my desire to learn it and my strategy on how I can accelerate the learning curve. They were impressed with that approach.
I would kick you ass if you sat in my interview verbatim and inside you are hallow.
|
|
|
|
|
Firstly plz mind your words, what do u mean by kick my ass?
I have not attended any interview from past 3 years. Work is different and Interview is different. In real time you might work on only few technologies.but when u attend an interview the questions rised would be on all the technologies and they might want latest updated technologies.
srikanth
|
|
|
|
|
Hi,
You can read Shiv Prasad Koirala's ".NET Interview Questions". It is a very good book. All the best.
Either you love IT or leave IT...
|
|
|
|
|
Hello all. I am facing a problem.I am creating a webpage and i want to make a dynamic menu control in asp.net 2.0 but dont want to use tree view.i want to make a menu control just like the menu of code project website.So please if anyone can give me the code so that. and i am using sql server 2000. I will be happy if anyone help me out.thanks
|
|
|
|
|
The CP menu is all JS, you can view the source or look on the web for similar menus.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
As we speak, I am writing dynamic asp.net menu. You see I am to put the menu in UpdatePanel, but it is not supported. My requirment is to build a menu to different Survery Database. The surverys are created real-time and my application need to load the current active surverys in menu dynamicllay.
There is no easy stright forward way of doing it. I have being working on this for alomost a week and half now, and got it working finally. (given not all time was spent on the menu).
I would love to write an artice about it someday, but tell me why in the world should I throw my code for such lazy person who expectes a code to be thrown in their way? Get your arse up the chair and leave the position to some one competenet.
----
Her is how I am doing it. I am a place holder inside an update panel. Then when an event is fired which I am interested in, I create my menus all from a code, including some js code, then add all the controls to the place holder. I got about 90% done and I have some formatting issue to handle.
|
|
|
|
|
thanks yusuf for the reply.i appreciate it. i'll gt ma arse up the chair lol. neways thx bruv
|
|
|
|
|
Please help me.
We are creating web application in which we have one requirement that, on inserting some text in Textbox displayed its related data on page.
Ex: When user put “A” in textbox, page should displayed all records of starting letter “A” like (Amit,Anil,Ashok,etc….) on selection of any record it should be placed in the textbox. like dropdown.
Thanx in advance.
|
|
|
|
|
use ajax autocomplete extender to you are requirement.
your's subbu
|
|
|
|
|
I am developing in VB.NET/ASP.NET with javascript (2005).
I'm getting an error on reported on my aspx page that does not match the actual code. It could be in the javascript, but I can't seem to find it. Is there a utility I can use that will debug the HTML and javascript?
Thanks, Chuck
|
|
|
|
|
etrtrrettdfgfgfgfgdgdgrtrtrtrrtttr
|
|
|
|