|
You can do this with AJAX, or you can write the values you want into the script as variables.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thx For reply
my need is i have a javascript array in that array i want put asp.net array values
For Example :
------------------
in the place of 'an apple','alligator','elephant','pear' etc.. i want to put asp.net array values
var customarray=new Array('an apple','alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin');
var custom2 = new Array('something','randomly','different');
Keerthi
|
|
|
|
|
OK, in this case, just write the values into your javascript from the code behind, no need to call it with AJAX, if the values are known, just pass them through.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi dear,
It is Possible to call c# function through javascript.
Please go through google, if again not able to find. plz write me at personalmail@mysampatti.com
By
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
u van also try by this trick
document.getElementbyId(HiddenButton).Click;
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
Hi
Kirthi,
It is possible To Do what u have asked :
Just Look At The Example given Below.
Here I have Passed The Values That I Get From TextBox
This Code U have To Write In Ur ASPX Page
<br />
<br />
<script language="JavaScript" type="text/javascript"> <br />
var cal = new CalendarPopup();<br />
cal.showNavigationDropdowns();<br />
</script><br />
<br />
And This IsWhat i have written in my Saprate Javascript File This Is A Function
<br />
function stepvalidation1(txtdate1,txtdate2,txtdatenow)<br />
{ <br />
var flag=0; <br />
var dt1=document.getElementById(txtdate1); <br />
var dt2=document.getElementById(txtdate2); <br />
<br />
if (isDate(dt1.value)==false)<br />
{ <br />
dt1.focus();<br />
flag=1;<br />
}<br />
else<br />
{<br />
<br />
if(step3validation(txtdate1,0,txtdatenow))<br />
{<br />
}<br />
else<br />
{<br />
flag=1;<br />
} <br />
} <br />
if (isDate(dt2.value)==false)<br />
{<br />
dt2.focus();<br />
flag=1;<br />
} <br />
else<br />
{ <br />
if(step3validation(txtdate2,0,txtdatenow))<br />
{ <br />
}<br />
else<br />
{ <br />
flag=1;<br />
} <br />
} <br />
if(flag>0)<br />
{ <br />
return false;<br />
}<br />
else<br />
{<br />
<br />
return true;<br />
}<br />
}<br />
and this is the line tht i have written in my .cs File
<br />
btn_Update.Attributes.Add("onclick", "javascript:return stepvalidation1('" + date1.ClientID.ToString()+ "','" + date2.ClientID.ToString()+ "','" + System.DateTime.Now.ToShortDateString() + "');");<br />
I think This Can Help
If Any doubt on the above then Ask
Just Do IT™ [Information Technology]™ :->
|
|
|
|
|
HI than Q
it is working fine but
in my web page i am binding values to a array.
that array values i want to pass in javascript.
var customarray=new Array(---- asp.net array values ------- + 'alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin');
Keerthi
|
|
|
|
|
Yes you can do this
I assume that u have a method in code behind which returns string, write a logic to return string in following format
Vaue1, value2, value3
<br />
SERVER Method(code behind): <br />
public string GetCommaSepratedUserNames()<br />
{<br />
return "'Manikandan.net, Prem.telecom, someName.Asp'";<br />
}<br />
Here value1, value2, value3 are your desired values, which u want to return from server.
Write the java script like bellow:
<br />
<script><br />
var customarray=new Array(<%=GetCommaSepratedUserNames()%>);<br />
<br />
var custom2 = new Array('something','randomly','different');<br />
</script><br />
<br />
Manikandan.net
[Coding is life]
|
|
|
|
|
HI
Is it posible to call asp.net function in javascript
Example
-
i have a javascript function in that i want to call the asp.net values
var customarray=new Array('in this i want to call asp.net values' );
var custom2 = new Array('something','randomly','different');
Than Q
Keerthi
|
|
|
|
|
Hi,
Using Ajax techniques(XMLHTTP) call back function you can execute ASP.NET functions.
Regards,
Manowj
|
|
|
|
|
Yes you can do this
I assume that u have a method in code behind which returns string, write a logic to return string in following format
Vaue1, value2, value3
SERVER Method(code behind):
public string GetCommaSepratedUserNames()
{
//write u r logic here, instead of my sample
return "'Manikandan.net, Prem.telecom, someName.Asp'";
}
Here value1, value2, value3 are your desired values, which u want to return from server.
Write the java script like bellow:
<script>
var customarray=new Array(<%=GetCommaSepratedUserNames()%>;
var custom2 = new Array('something','randomly','different');
</script>
Manikandan.net
[Coding is life]
|
|
|
|
|
Hi Experts,
Here i stuck to a problem with search functionality to be implemented in my web page.
I have to do serach by using all the key words like OR,~,- etc. just like google.
So i am unable to find out the method to do same.
what i only found is full text serach through SqlServer 2005 but i dont want to use that.
Please suggest be Better.
Thanks is advance
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
hi,
I want to redirect the user if he copy and paste the url of a post login page in a new window. I think there should be some settings in web.config.
I am using aspdotnet 1.1 with vbdotnet.
If any one has a solution for that please send me the code to implement this in my project.
thanks in advance
bikash
|
|
|
|
|
Hi,
you can solve your problem using below tips.
1. Store user name and password in Session and check on every page load whether they are right or not.
2. Store any other variale in Application start (global.asax) and check in every page Load.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
|
|
Hi
got 3 option
if op1 then date will be Today + 7 = 08/12/2007
if op2 then date will be Today + 14 = 15/12/2007
if op3 then date will be Today + 90 = 01/03/2008
n.b. every month doesn't have 31 days
any instruction will be helpful
Sarfarj Ahmed
|
|
|
|
|
hi dear,
u have check all these dynamically through code.
i prefer u to use Switch case for that.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
You can simply write nested if condition for the options and add the required number of days to the date.
For e.g.
dim dt as Date=System.DateTime.Today
dim dtResult as Date
if option=op1 then
dtResult=dt.AddDays(7)
else if option=op2 then
dtResult=dt.AddDays(14)
else if option=op3 then
dtResult=dt.AddDays(90)
end if
so in dtResult you have resultant date after adding the required no. of days.
You need not worry about whether u have 30,31 or 28 days month.
Ujjaval Modi
|
|
|
|
|
Dear Modi
Thanks a lot for your help, it does work and i have already rated you
also could you please tell me, what is the best way to send date into sql server 2005 from asp.net?
1. send date as a string
2. send date as a date
3. change date format "MM/dd/yyyy"
in sql server date format is dd/mm/yyyy so why i can not send date to server as a date dd/mm/yyyy from asp.net
im really confused need your valuable instructions
thanks in advance
Sarfarj Ahmed
|
|
|
|
|
Send Date As Date Type in the following Format 'MM/dd/yyyy'
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
Send the date as a date only
u can use Format function to format the date in dd/mm/yyyy format.
if that does not help mail me ur code snippet at ujjavalmodi@gmail.com
Regards,
Ujjaval Modi
|
|
|
|
|
Hi how to make enduser can download some files from our webpage?,
Means how to provide our server contained doc to client...,
Plz share me some ideas abt this...,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
HMagesh wrote: Hi how to make enduser can download some files from our webpage?,
Give link to the file which needs to be downloaded. When clicking on that link, browser will open download box.
|
|
|
|
|
Hi all
I want to use autocomplete textbox's on my webpage for that i used this code
http://munich.schwarz-interactive.de/autocomplete.aspx[^]
on page load
Dim txt As New AjaxAutoComplete
txt.ID = "txtAutoComplete"
txt.OnAutoComplete = New AjaxAutoComplete.AutoCompleteHandler(Me.OnAutoComplete)
PlaceHolder1.Controls.Add(txt)
but i am getting errors
'Type AjaxAutoComplete is not defined'
plz tell me what i am missing in the code
Than Q
Keerthi
|
|
|
|