|
i want to compare the value of two text boxes and on true/false condition i want to display the message in a dialog box.....can any one help me with the coding in javascript????
|
|
|
|
|
if(document.GetElementById("txt1").value == document.GetElementById("txt1").value)
{
alert("Some message");
}
else
{
alert("Some message");
}
What's so difficult?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: What's so difficult?
Using the correct operator?
|
|
|
|
|
Guess the syntax validator addin stopped working.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Hi I've a problem with the property .SelectedText.
I've Microsoft Visual Web Developer Express 2008 - Framework version: 3.5.
The problem is that Visual Studio can not find this property, I also checked that there were any dll.
Property. SelectedText is in the System.Windows.Controls namespace right?
I don't know where wrong, please help me!
Here is the msdn page from which I copied the code:
http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.selectedtext.aspx
|
|
|
|
|
It would seem that you are confusing two entirely different things. If you are developing for the web, the TextBox you are probably using comes from the namespace System.Web.UI.WebControls . That control does not have a SelectedText property. You should confirm that you are linking in the correct namespace.
|
|
|
|
|
I understand, but how do I catch the selected text from an asp:textbox and put it in a string variable?
But on that msdn page I linked, it seems that talk of a web application ... is not very clear!
Thanks for the help!
|
|
|
|
|
Notice the namespace referenced at the top of the article you linked: System.Windows.Controls. That means it is written using Windows Presentation Foundation (WPF), not ASP.Net. In web browsers, WPF is implemented through Microsoft Starlight, which is basically a subset of WPF merged with AJAX. This lets you preserve user states, such as what the user has selected in a text box. Normal ASP is built on the HTML protocol which is stateless: postbacks are handled by sending a hidden form, which gives the information (text in a textbox) but no metadata (what part of that text is selected.) That is why the standard ASP controls do not have properties like SelectedText .
I don't think you can do what you want to do using ASP. WPF and Silverlight has a lot of very interesting and useful functionality, but there is a bit of a learning curve. You could try posting your question in the Web Development or Silverlight forums, but it might be better to either figure out a different way to get what you want, or buckle down and learn a new programming tool. Unfortunately, I've not had the time to learn it myself, so I'll just shut up now.
|
|
|
|
|
You can do that using JavaScript. As far as I know, you cannot do this from CodeBehind.
|
|
|
|
|
In my Listview InsertItemTemplate I have the following Label:
<asp:label id="IDNOInsertLabel" runat="server">I use the following VB statement (which works on a Formview) to popuate said Label:
CType(lvPTRPhoneCalls.FindControl("IDNOInsertLabel"), Label).Text = lblSelectedIDNO.Text
It gets an "Oject reference not set to an instance of an object" error.
How/when/where can I popuate a Label in a Listview using VB?
Thank you.
|
|
|
|
|
I'm not sure where the problem might be, but you can rewrite this a bit to help with the debugging.
Dim Obj As Object = lvPTRPhoneCalls.FindControl("IDNOInsertLabel")
If Obj IsNot Nothing Then
Dim Lbl As Label = TryCast(Obj, Label)
If Lbl IsNot Nothing Then
Lbl.Text = lblSelectedIDNO.Text
Else
End If
Else
End If
With this, you can see if the control is not being found, or if it is found but is not a label.
|
|
|
|
|
When I'm executing project in this function this exception rises
private void callbackDoSomeWorkA(IAsyncResult ar) {
string retval = sa.EndDoSomeWorkA(ar);
Stack stack = Session["Status"] as Stack;
stack.Push(retval);
}
WebException was unhandled by user code - The server committed a protocol violation. Section=ResponseStatusLine
what's the problem? Does enybody know it?
C# Developer
modified on Tuesday, March 30, 2010 2:08 PM
|
|
|
|
|
Google gave me this explaination for the error:
the problem is actually caused by the critical http header parsing/validating
of the HttpWebRequest component. According to the Http
Specification(http1.1), the HTTP header keys shoud specifically not include
any spaces in their names. However, some web servers do not fully respect
standards they're meant to. Applications running on the Dotnet framework
and making heavy use of http requests usually use the httpWebRequest class,
which encapsulates everything a web oriented developer could dream of. With
all the recently issues related to security, the "httpWebRequest" class
provides a self protection mechanism preventing it to accept HTTP answers
which not fully qualify to the specifications.
The common case is having a space in the "content-length" header key. The
server actually returns a "content length" key, which, assuming no spaces
are allowed, is considered as an attack vector (HTTP response split
attack), thus, triggering a "HTTP protocol violation error" exception.
Setting this would help:
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration>
Detailed link by Microsoft support[^]
UPDATE: Also look at this link... this too involves above config but states some changes in Port!
http://channel9.msdn.com/forums/TechOff/257803-HttpWebRequestResponse-The-server-committed-a-protocol-violation-SectionResponseStatusLine/[^]
modified on Tuesday, March 30, 2010 1:10 PM
|
|
|
|
|
I've done like this...
but is is same error
C# Developer
|
|
|
|
|
In my Listview I have the following Label in the <inserrtitemtemplate>
|
|
|
|
|
Can you please edit and make the formatting correct. Its hard to read right now!
MarkPhD wrote: "Object reference not set to an instance of an object" error.
Based on this, it means that there is some problem at this line of yours:
CType(lvPTRPhoneCalls.FindControl("IDNOInsertLabel"), Label).Text
For now, looks like a bracket missing.... try this:
(CType(lvPTRPhoneCalls.FindControl("IDNOInsertLabel"), Label)).Text
P.S.: Assuming the control exists in 'lvPTRPhoneCalls'... thus CType(lvPTRPhoneCalls.FindControl("IDNOInsertLabel"), Label) is not null !
|
|
|
|
|
Hi Friends..
I am using Asp.Net c# one of my project, there i am using QueryString to pass value from one page to another page as (www.xyz.com?a=old#10),
value=Request.QueryString["prd"]
the problem is that IE6 taken value=old#10 where is all browser taken value=old kindly help me i need only old .
|
|
|
|
|
Have you tried to encode the url
Server.URLEncode('www.xyz.com?a=old#10");
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Solve by string.replace(IndexOf)
|
|
|
|
|
How did this solve your issue?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I think he did substring from the start to the index of '#' sign... ... otherwise we need to learn the programming again...
|
|
|
|
|
hi sir,
i am new in asp.net.sir i want to know that is there any java script with the help of which we can stop page reloading at the time of using ajax control.and dropdown text selection.
sir i know that update panel can do this.but sir i do not want to use update panel.i mean i want to stop my page reload without using update panel while i am using ajax.
please help me sir i am posting my this question again.
because first time i did not get any response.
|
|
|
|
|
Ajax is an out of band technology that does not require your page to reload. There are many, many examples for Ajax here and elsewhere.
One thing to make sure to do is set AutoPostback to false on your dropdownlist so it does not postback
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Do you have a reason you don't want to use an update panel?
Your question is like asking about getting a nail into a piece of wood but refusing to use a hammer. When you make silly restrictions with no reasons behind them you are less likely to get help because you might dismiss other good solutions for no apparant reason as well.
|
|
|
|