|
You can split value with appostophie character in javascript.
get itExample
or
if you want substring of value then get it Example
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Make autopostback=true of drop down list. This will post the page when drop down list changes. Handle it's selectedindexchanged event, and bind the gridview here with the required values.
|
|
|
|
|
i have a button and a textbox control.I am executing a chunk of code , on the button click event, there in the button click event,i am validating the textbox(whether the textbox is having some value or not).i wanted to do the validations at the client end.i mean first i want to validate the textbox in the javascript , if it is having some value , only then the code behind code should execute.How should i do it.Main thing is i want to execute the code behind file code , if the textbox is having some value , otherwise , the postback should not happen.
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: i wanted to do the validations at the client end.i mean first i want to validate the textbox in the javascript , if it is having some value , only then the code behind code should execute.How should i do it
Assume your button is button1. So in page load event, write something like
button1.Attributes.Add("OnClick","return MyJSFunc();");
This will add the Onclick attribute to the button. Now inside the MyJSFunc() , get textbox element and check the value. If value is ok, return true else return false .
function MyJSFunc()
{
var TxtBox = document.getElementById("YourTextboxId");
if(TxtBox.value == "")
{
alert("Enter value");
return false;
}
else
return true;
}
These are the basic things, and I recommend you to buy a book and learn how things are working.
|
|
|
|
|
How to make an array of buttons so that whenever i click any of my buttons i should get it's text ??????????????
pls reply as soon as possible...bcos i m new in asp.net and i got stuck in my project
|
|
|
|
|
but why you want to create an array?
I did give an example yesterday.
can you tell me whats your exact problem?
bEst rEgard
pAthan
|
|
|
|
|
exactly i want to create a calculator..for that i have to check whether a button clicked is digit/opeerator/other..for that if i take simple buttons then i have to ckeck for each buttons..instead i want to do like that if i press any button then i should get it's text i.e. whether it is digit/operator/other????????
|
|
|
|
|
I did give you an example.
cosider you have four button for "+" ,"=","1" and "2"
html source code
asp:button id"btnplus" runat="server" onclick="calendar_click" Text="+" />
asp:button id"btnequal" runat="server" onclick="calendar_click" Text="=" />
asp:button id"btnone" runat="server" onclick="calendar_click" Text="1" />
asp:button id"btntwo" runat="server" onclick="calendar_click" Text="2" />
global val
int prevVal,CurrVal;
event
protected void calendar_click(object sender,....)
{
string key=((Button)Sender).Text;
switch(key)
case "+":
preVal=int.Parse(txtVal.Text);
txtVal.Text="";
break;
case "=":
currVal=int.Parse(txtVal.Text);
txtVal.Text=preval+currVal;
break;
case "1":
txtVal.Text=key;
break;
case "2":
txtVal.Text=key;
break;
}
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
ajsgja wrote: How to make an array of buttons
You can't make array of buttons. I think you are from VB background, and talking about control array, it's not possible here with C#
-- modified at 3:40 Saturday 27th October, 2007
|
|
|
|
|
ok so how can i do it here.....control array..is there any other way to do it here
|
|
|
|
|
N a v a n e e t h wrote: You can't make array of buttons
Button[] buttonArray = new Button[5];
|
|
|
|
|
|
i want to do it in asp.net..is it possible
|
|
|
|
|
it's possible in ASP.NET. Place a Container Control(placeholder) in your ASPX Page, Create the number of Button Control's dynamically and Add each control to the placeholder's Control Collection and set the Properties. This code has to be written on the OnInit of the Form to make the dynamical control participate in the viewstate. I tested. It work's perfect in my system. try it out...
-- modified at 5:17 Saturday 27th October, 2007
Regards - J O H N -
|
|
|
|
|
Hi Friends,
I need an exapmple for calendar contol using Asp.net.
Please help me.
|
|
|
|
|
In asp.net calender control tool is there...,
Y u cant use that?,
Or u need calender control like pop up?,
If U Like My Post Rate This MSG
Regards,
Magi
|
|
|
|
|
Thanks for your replay.
I used DTpicker control to display the clender and which is not displayed correctly on my page.Because the contol like Dropdowndown box hides the calendar.I couldn't see the calendar well on my page.
So i need to use Asp:Calendar control which should display the calendar well on my page.
Please reply friend.
|
|
|
|
|
|
Thanks for your replay.
I used DTpicker control to display the clender and which is not displayed correctly on my page.Because the contol like Dropdowndown box hides the calendar.I couldn't see the calendar well on my page.
So i need to use Asp:Calendar control which should display the calendar well on my page.
Please reply and give me good example.
|
|
|
|
|
Take canledar control right side to all controls.
if you are using asp.net 2.0 get it Calendar Extender
best Regard
pathan
please don't forget to vote on the post that helped you.
|
|
|
|
|
A quick search in google[^] returned thousands of calendar controls. Which will you interested to ? AJAX toolkit comes with an excellent calendar extender control, If you application is in ASP.NET 2.0, and it supports AJAX, you can use this.
|
|
|
|
|
|
hi friends
im in new to asp.net i want display news feed in marquee method get news from any other news website........
karthi
|
|
|
|
|
You can use normal marquee tag of HTML to marquee text in asp.net also.
|
|
|
|
|
Hi,
Can anyone send articles about Tab menu control for my Asp.Net application. Please help me out.
|
|
|
|