|
Page.ClientScript does not work when we use ajax on our page.Use
ScriptManager.RegisterStartupScript instead. it'll work
|
|
|
|
|
Thanks. It worked
|
|
|
|
|
Java script is case sensitive, your defined function and calling function should be same
Farogh Haider
Web developer
|
|
|
|
|
Hello All,
I am generating one tab delimited text file.
I need to copy the contents of this file into one excel file's sheet.
Please help.
Thanks in advance.
Regards,
Swati.
|
|
|
|
|
|
Hi,
This is from chandrakanth. working on dotnet.
Actually i got one problem with javascript in button click event.
i have one Datalist control. In that Datalist control i have one Linkbutton. I am trying to find the ID of Link button ID through Javascript.
But it is giving error here
"obj.substring(0, 60);"
--Object does not support this property";
Please see the below my Javascript code which i am using.
---------------------------------------------------------------
'sidebar' -- divtag id
function SwitchMenus()
{
var divObj = document.getElementById('sidebar');
var objdatalist = document.getElementById('<%#dlstToDoList.ClientID%>;').childNodes[0];
var obj = objdatalist.getElementsByTagName('ctl00_dlstToDoList_ctl00_lnkTodo'); -- Link button id
if (divObj.style.width == "22%")
{
divObj.style.width = "26%";
divObj.align = "left";
objdatalist.style.width = "100%";
obj.substring(0, 60);
}
else {
divObj.style.width = "22%";
divObj.align = "left";
obj.substring(0,40);
}
}
-------------------------------------------------------------
----------------------------------------------------------------
|
|
|
|
|
chandragaddam wrote: obj.substring(0, 60);
what are you trying to do here?
you are trying to use substring() method with an object, so it wont work .this function work with strings. make the changes accordingly
|
|
|
|
|
chandragaddam wrote: "obj.substring(0, 60);"
As per your query , you have problem in the above line.
What you have written is bound to get an error like that. Because, "obj" is a reference to a control. And as control does not have substring method in javascript you get this error. You should call obj.innerText or obj.value which ever is applicable in your case( depending upon what the control is rendered in your browser for your code) then call the substring method.
Thanks,
Arindam D Tewary
|
|
|
|
|
Hi im using ajax modal popupextender.. panel consisting of a captcha image,textbox and a button control.. How can i display error message in modal popup itself. if the condition is false i.e, if textbox value doesnt match with captcha...
|
|
|
|
|
Have a label to show the error message.Initially hide it, and show the when there is an error..
Are you asking something else?
|
|
|
|
|
once i click on the button in modal up it disappears whether textbox value is matches or not... I want to display in modal pop up itself if textbox value is false....
|
|
|
|
|
there must be postback on button click,after postback the modelpop will hide.Do one thing ,Attach a clientside event, validate the request if there is an error, show from javascript itself. and if there is no error continue with postback.
|
|
|
|
|
You can also solve this "issue" by calling the Show Method of the extender again within you button click-event (when you're also setting your error-message). This prevents the modal-popup from hiding.
Example:
if (error)
{
lblError.Text ="Something is wrong";
myPopupExtender.Show();
}
else
{
}
Michael
|
|
|
|
|
Hi.
On a button click i'm opening a page with showModalDialog,
depending on the value returned from modal dialog,
i want to clear contents of asp.net controls.
These controls are read only controls.
But i'm unable to clear the controls.
Please guide me how to resolve this issue.
Thanks in Advance.
|
|
|
|
|
Find the element on the page via JavaScript and clear it appropriately
document.GetElementById("somecontrol").value = "";
of JQuery
$("#somecontrol").val("");
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi.Thanks for you reply.
document.GetElementById("somecontrol").value = "";
this code is valid,but in my case i'm unable to do it,
var URL = 'AddParticipant.aspx?Id='+EventId+';<br />
retVal = showModalDialog(URL, false, "dialogHeight:700px;dialogWidth:900px;scroll:yes;");
I'm able to retrieve the value well. after that i wrote following
document.getElementById("<%=txtOrderNo.ClientID%>;").value="";
But i'm unable to clear the content. and the textbox is readonly, and the page is in side updatepanel.
Does it have anything to do..
Thanks again
|
|
|
|
|
Remove the semicolon after the binding expression
document.getElementById("<%=txtOrderNo.ClientID%>;").value="";
it should be this
document.getElementById("<%=txtOrderNo.ClientID%>").value="";
The former is adding the semicolon to the id which of course can't be found in the dom.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Pls how do i prevent page reload each time i select an item from drodownlist whose postback is set to true.
thank you.
|
|
|
|
|
This can be easily done by using AJAX. Use AJAX Update panel and place your dropdown list inside update panel.
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
use ajax update panel
Ravie Busie
Coding is my birth-right and bugs are part of feature my code has!
_________________________________________
Me
Facebook
Twitter
|
|
|
|
|
Completely true..
Use AJAX Update Panel.
jaypatel512
|
|
|
|
|
You should use ajax with update panel
Farogh Haider
Web developer
|
|
|
|
|
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
}
}
public class test
{
string strID;
public string hello()
{
strID= this.txtTextBox1.Text; //here i am confused with my basic concept (can i assign value to strID from TextBox and if yes then how to get TextBox Value from form2 because I am making a new class here)
return strID;
}
}
}
|
|
|
|
|
How this is related with ASP.NET ? This is your Windows Application ..
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Create a static class with global var,
in you form 2, asign the value of text box to the var,
you can use the value anywhere you want by refrencing the class and the varibale.
hope this helps.
|
|
|
|