|
Hi,
Try javascript:
function change_app()
{
var ddl = document.getElementById("DropDownList1")
document.bgColor = ddl.options[ddl.selectedIndex].text
}
And in HTML: onclick event of the button call the function.
Thanks & Regards
Mishra
|
|
|
|
|
Hello Mishra, thanks for your response. One of the requirements is to not use Java script as most screen readers can’t read it to well. Could you tell me how this could be accomplished on the server side (that is either programitically in the code behind or perhaps in html writing server side code in <% block. I’m pretty new to asp.Net and don’t know much about it. Please suggest what should I do.
Thanks
Tina
|
|
|
|
|
Hai,
I had creted webpage where user needs to submit the data regarding software request. I had done with page by creating master page. The data submission is working fine in this page. Here i wrote some client side scripting(Java Script) for validation and they are not working. i placed the client side code in the master page . The question here is that for all the pages inherting the master page, can i place the client side scripting in the master page itself?
i placed the scripting code on the clientclick event of the submit button.But when i click the button its directly inserting data in to database with out on any client side check.
Can you please help me how can i figure out the error regarding this.
Thank you,
Veerendra
|
|
|
|
|
Hello All,
I am new to asp.net and probably have a simple question, I have created a datalist which has 6 fields all labels these are "propref", "zone", "type", "typext", "link", "filename" these are populated by the database,
What I am trying to do is get the text value of the "type" label and copy it into a label called "res" outside the datalist
I tried:
Private Sub Datalist1_ItemCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) _
Handles DataList1.ItemCommand
Dim l As Label
l = CType(e.Item.FindControl("type"), Label)
If (Not l Is Nothing) Then
res.Text = l.Text
End If
End Sub
But didnt display anything,
Any help will be much appreciated,
Regards,
Adrian
|
|
|
|
|
This is probably a daft question.
Can I open an asp.net 1.0 project in Visual Studio 2005 and not convert it to an asp.net 2.0 project ?
I have VS2005 installed on my machine (with asp.net 2.0 I believe) but the server I am deploying the project on only uses asp.net 1.0
Thanks
|
|
|
|
|
No, I think if you open a 1.0 project it will ask you to upgrade it.
|
|
|
|
|
|
Hey guys,
I am working on a asp.Net (1.1) site. Basically I need to add a couple of new pages. The page would have a few drop down displaying bgColor options, font options, and text size. Now when the user selects one or all of these options, and click the submit button… I should be able to change the page’s look appropriately. So for instance, if a user selects red for the background, Arial for the font and 10 as the size…on button_click event these properties should apply to the page. Now I am grabbing the value from the drop down ( string currentColor = ddl1.SelectedValue; )
I notices that the page control, doesn’t have the body or html form element, so now how do I apply this color property for example to the entire page. My guess is I’d have to go under HTML mode of aspx page and do it there.
Please suggest what is the best approach here.
Thanks
Tina
|
|
|
|
|
In your aspx page use a table element.
<br />
<table border="0" cellpadding="0" cellspacing="0" style="width:100%"><br />
<tr><br />
<td runat="server" id="tdMain"><br />
Put content here<br />
</td><br />
</tr><br />
</table><br />
<br />
Server side code should be like this<br />
me.tdMain.Style.Add(" background-color", "red");<br />
|
|
|
|
|
Thanks for the response. Like I said I need this to happen when the user clicks the button and the button click event fires. Which means either I should do it on the server side somehow under button1_click event handler or like you said in aspx page. What you have showed me, sounds like is static…it will change the color right away I only want it done on button click. Also shouldn’t I be using the whole body element (i.e. form1.Style.Add (“bgColor”. Red) since I want the color to be applied to the entire page???
Thanks
Tina
|
|
|
|
|
<br />
<br />
The idea is that you put all the content of your page inside the single table cell and it will affect the entire page.<br />
<br />
<form id="Form1" runat="server"><br />
<table border="0" cellpadding="0" cellspacing="0" style="width:100%"><br />
<tr><br />
<td runat="server" id="tdMain"><br />
<br />
ALL CONTENT<br />
<br />
<br />
</td><br />
</tr><br />
</table><br />
</form><br />
<br />
<br />
You can modify the style of tdMain from any event. You can add and remove style elements during the button_click event.<br />
GameFly free trial
|
|
|
|
|
Well it’s not a pretty simple page. It’s got 3 user controls and a lot of other UI elements. Please elaborate on how to apply the above mentioned properties when that button is clicked (as you said above “can add and remove style elements during the button_click event.”).
Thanks
Tina
|
|
|
|
|
Hi All
I have a web page, having two tables and lots of controls in them. when user finishes entering data in table1 and clicks button then second table gets enabled.
In the second table there is a user control and couple of buttons (btnContinue, btnClear). userControl consists of dropdown and textbox.
When user finishes entering data in textbox(Present in usercontrol) and press "ENTER" key, the btnContinue on aspx page should get clicked.
We are using Asp.Net 1.1, VS2003
Can some one help me coming out of this?
mk
|
|
|
|
|
Add the following to your aspx code.
<script type="text/javascript"><br />
function ButtonPress (evt, btnID) {<br />
if (evt.keyCode == "13") <br />
{evt.returnValue= false ; evt.cancel= true ; document.getElementById(btnID).click(); return false; }<br />
}<br />
</script><br />
<br />
In the codebhind add the following.<br />
Dim ObjButton as Button = UserControl.Findcontrol("ButtonId")<br />
<br />
Me.Textbox1.Attributes.Add("onKeyPress", "ButtonPress(event, '" & ObjButton.ClientID & "')")<br />
<br />
<br />
Does that help?
GameFly free trial
|
|
|
|
|
Hi ToddHileHoffer
I understood the script, but not the codebehind code.
can you elaborate a bit.
// Dim ObjButton as Button = UserControl.Findcontrol("ButtonId")
My Button is in aspx page and text box in user control.
// Me.Textbox1.Attributes.Add("onKeyPress", "ButtonPress(event, '" &
ObjButton.ClientID & "')")
what is C# equavalent for "Me" ?
And more over do i need to write this in code behind of aspx page or UserControl?
Sorry for confusion.
mk
|
|
|
|
|
sorry, here is the C# for your code behind.
<br />
Textbox txt = (Textbox) Usercontrol.FindControl("TextboxID");<br />
this.txt.Attributes.Add("onKeyPress", "ButtonPress(event, '" &<br />
this.Button.ClientID & "')");<br />
Does that work for you?
|
|
|
|
|
Hi ToddHileHoffer
It worked perfectly. Thank You Very Much.
|
|
|
|
|
I am looking for a Complete ASP.NET Forum Source Code(free).If I get one It will be gr8.Otherwise I have to create my site's forum.Plz tell where I can get Complete ASP.NET Forum Source Code(free).
|
|
|
|
|
|
Yahoo store has the option of recieving realtime orders using http post in xml format. Yahoo has the ability to call a page on our webserver along with the xml data in http post. I created the following code to try and retrieve the post, but when I Response.Write the output it is blank.
Page.Response.ContentType = "text/xml";
// Read XML posted via HTTP
StreamReader reader = new StreamReader(Page.Request.InputStream);
String xmlData = reader.ReadToEnd().ToString();
Does anyone know of another method to retrieve the xml in http post using asp.net and c#. Thanks in advance.
|
|
|
|
|
hi,
i have one table, inside that table i am creating two panels
now i need to put one line between two panels or can u tell how to differentiate two panels.i dont want to aplly the bgcolors.
|
|
|
|
|
In your html on your table you can make the border of any element visible.
EG style=" border-bottom-style:solid; border-bottom-width:thin; border-bottom-color:Gray"
|
|
|
|
|
hey guys
The user shouldn't put any html tags in the TEXTBOX, how can i handel this.
Estarta
|
|
|
|
|
User regular expressions to find any html.
Check this link for more info about regluar expressions and then be creative.
|
|
|
|
|
thanks alot for your reply, but this not what im looking for
i wanna prevent the user from using HTML tags or any special characters in the input box.
thanks anyway
Estarta
|
|
|
|