|
hi all....
i'm using html input button for this purpose....but i'm unable to retrieve the values in .cs file....what i want is to display arrangement of around 100 seats in a theatre...and would like user to select some seats whose color will change on clicking without reloading the page.....and in .cs file i may be able to retrieve the seat numbers...???
same seat chart as you would find one while booking tickets for a movie online....they ask you select seats of your choice....i wanna do the same thing....can anyone help me???
|
|
|
|
|
hi sashidhar.....
i tried to use the update panel.....i took an update panel.....and 5 buttons....took a session variable and incremented it on click event of each button.....it all worked but the problem now is if i refresh the page the value of session variable is not refreshed....counting starts from the last where the page was refreshed....i'm providing you the code....Have a look....!!!
The default.aspx File:
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<asp:Button ID="Button6" runat="server" onclick="Button6_Click" Text="cancel" />
<br />
<br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<br />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Panel Created"></asp:Label>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" BackColor="Aqua"
onclick="Button1_Click" Text="Button" />
<br />
<br />
<asp:Button ID="Button2" runat="server" BackColor="Aqua"
onclick="Button2_Click" Text="Button" />
<br />
<br />
<asp:Button ID="Button3" runat="server" BackColor="Aqua"
onclick="Button3_Click" Text="Button" />
<br />
<br />
<asp:Button ID="Button4" runat="server" BackColor="Aqua"
onclick="Button4_Click" Text="Button" />
<br />
<br />
<asp:Button ID="Button5" runat="server" BackColor="Aqua"
onclick="Button5_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
now the Default.aspx.cs File:
The code was given on click event of all buttons taken in update panel:
int i = Convert.ToInt32(Session["i"]);
i++;
Session["i"] = i.ToString();
Button3.BackColor = System.Drawing.Color.Red;
Label1.Text = "Refreshed at " + DateTime.Now.ToString();
Button3.Enabled = false;
|
|
|
|
|
please tell me how can i refresh the value of session variable on page refresh
|
|
|
|
|
Will there be any problem for image to display in runtime? If IIS is not installed in our system?
Every time in run time the image in not viewable but while at design time it is viewable.
|
|
|
|
|
1. Displaying images does not depens upon IIS. If you dont have IIS then you can not host an .NET web application.
2. It seems that you can run the application and in runtime you can not see images. FYI, you mention images path in controls of your application and at runtime, the images path should match to the actual physical location images.
if you dont see images, rather you get to see 'image' control but a 'cross' showing images not displayed, right click on images to get to see what path the control is expecting at runtime. Depending upon that you should modify the image path in design view.
Please let me know if you get it going.
Thanks,
Arindam D Tewary
|
|
|
|
|
In each system it wil be prefixed with Local host number. the same code is working in other system. then what would be the problem? On ur suggestion i had right clicked on the image this was the link http://localhost:49216/ws/App_Data/pics/pic1.jpg in this except local host and its number my path is same
asp:TableCell ID="TableCell4" ColumnSpan ="2" VerticalAlign = "Top" HorizontalAlign ="Center" runat ="server">
<asp:image id="Image1" runat="server" imageurl="../../../../../App_Data/pics/pic1.jpg">
|
|
|
|
|
thanks fr d info will try it out and let you no
|
|
|
|
|
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 .
|
|
|
|