|
You can't use a JavaScript function in C#, they are two different languages meant for two different environments.
only two letters away from being an asset
|
|
|
|
|
but we know .net works on cross platform as well also.so why we can't use]
js in C#
u can use the following code to call js in C#
ScriptManager.RegisterStartupScript(this, typeof(String), "CALL", "FunctionName();",true);
U can also use Page.Clientscript instead of scriptmanager
|
|
|
|
|
ScriptManager.RegisterStartupScript(this, typeof(String), "CALL", "FunctionName();",true);
This does not call the JavaScript function, it inserts the script into the page. RegisterStartupScript also only have three parameters, see below.
http://msdn2.microsoft.com/en-us/library/asz8zsxy.aspx[^]
only two letters away from being an asset
|
|
|
|
|
|
You're correct. I meant to say the method doesn't take five params.
Arun J wrote: But while checking MSDN check thoroughly,and after that only give comments.
Perhaps you should also check your information before replying. You were the one who originally responded that this method had five params and could be used to call JavaScript from within C#.
only two letters away from being an asset
|
|
|
|
|
I meant the code with four parameters.I didn't write that this have five parameters.That code had mistake thats right, but its only a normal posting mistake.And also as i told he can find the overloads by intellisense.As a supporter, u should be more careful than members like us while posting informations.
Arun J
|
|
|
|
|
Arun J wrote: I didn't write that this have five parameters
Then why did you post it?
Arun J wrote: As a supporter, u should be more careful than members like us while posting informations.
It doesn't matter the status, everyone in this community should post accurate, not misleading or irrelevant, information. However, we are all human and make mistakes. Forgetting an extra param is a mistake. Posting code that isn't yours (without giving credit to the author) that is not correct, and doesn't answer the question, is not a mistake.
only two letters away from being an asset
|
|
|
|
|
|
Stop trying to prove yourself right, you have missed the point. The original question was "How i can call js function in c#." None of your replies have addressed this.
Arun J wrote:
Use this
ScriptManager.RegisterStartupScript(this, typeof(String), "CALL", "FunctionName();",true);
U can also use Page.Clientscript instead of scriptmanager.
Your reply was incorrect, misleading and did not answer the original question.
You can not substitute Page.ClientScript for ScriptManager. The latter is from the ASP.NET AJAX library while the former is in the System.Web namespace. Two completely different things. Nor can you use this to call a JavaScript function from within C#, as asked by the original poster.
I know you will post a reply to this, let's just hope it answers the original question rather than being another lame attempt to prove yourself right.
only two letters away from being an asset
|
|
|
|
|
|
Your reply was correct, leading and answer to the original question.
Arun J
|
|
|
|
|
Hi
In my asp.net web application on hyperlinl click i call
http://localhost/indtest/filecontent.aspx?id=e:/src/backup/lister,/292372727.rtf
above url.but i want to restrict the visible of id value. that means how can i set "e:/src/backup/lister,/292372727.rtf" invisible in browser.
Plz help me to solve this problem.
regards
Venkat.
venkat
|
|
|
|
|
Hi
In my asp.net web application on hyperlinl click i call
http://192.168.13.251/indtest/filecontent.aspx?id=e:/src/backup/lister,/292372727.rtf
above url.but i want to restrict the visible of id value. that means how can i set "e:/src/backup/lister,/292372727.rtf" invisible in browser.
Plz help me to solve this problem.
regards
Venkat.
venkat
|
|
|
|
|
Encrypt the id before passing.
|
|
|
|
|
Hi there guys n girls,
I am currently developing a document management system. There are a flexible number of roles and each document can have its access rules set so it can only be accesssed by users belonging to certain roles.
Each user can belong a a number of roles too.
So in essense there is a many to many relationship between roles and users and a many to many relationship to documents and roles.
I'm using the built in .NET membeship / role features and was wondering if anyone had come across a tutorial which might cover this kind of thing. Really want a good point of reference to implement best practise and not found anything on the web yet which covers exactly what i'm after.
Thanks in advance
Steve
"Gödel proved that any formal system that defines the primitive recursive functions must be either incomplete or inconsistent. In particular one could not prove from within the system that the system itself was consistent even though the question could be formulated within the system."
|
|
|
|
|
I have done a similar application, but without using membership providers. I created custom classes to manage roles. What I did is keeping the roles and users belongs to that in a database which my custom classes can read and validate the role.
|
|
|
|
|
Dear all,
I am now developin my applications on vs2003 with frameworl v1.1.
I want to upgrade to VS2005.In my system i have installed VS2003 and sqlserver2000.
Is it true that we can develop application in vs2005 with swlserver2005??If not i will use my sqlserver2000.
And if i install vs2003 and vs2005 in the same maching which type of problems may occur??
What i have to do?My applications were developed in vs2003,so if i upgrade can i do any modifications in the already developed appln??
plzz clear my doubts and suggest me with the proper way.
I fa i can install,can i install in the same directory??
kissy
|
|
|
|
|
Kissy16 wrote: Is it true that we can develop application in vs2005 with swlserver2005??If not i will use my sqlserver2000.
ADO.NET 2.0 can be used with SQL 2000.
Kissy16 wrote: And if i install vs2003 and vs2005 in the same maching which type of problems may occur??
Usually nothing will happen. I have 3 versions(1.1,2.0,3.5) installed on my machine, and all are working without making any problem.
Kissy16 wrote: My applications were developed in vs2003,so if i upgrade can i do any modifications in the already developed appln??
Yes you can do modifications to the application by opening it in VS2005. You won't be able to use it with VS2003 after upgrading.
|
|
|
|
|
Hi i am displaying some values in datagrid one boundcolumn,
Like this:
Ids:
1
2
3
4
5
Now in that paricular value only have to show in hyperlink,
Ex: the 2 value have to show in hyperlink,
its possible to show like that?,
any one have idea abt this?,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
try this in RowDataBound event of grid.
if (condition)<br />
{<br />
HyperLink hypLink = new HyperLink();<br />
hypLink.Text = "Click Here";<br />
hypLink.NavigateUrl = "Default.aspx";<br />
e.Row.Cells[0].Controls.Add(hypLink);<br />
}
Arun J
|
|
|
|
|
Hi i am using vs2003,
u given for vs2005,
the same code will be work on item bound?
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
|
Use it in Itembound and instead of row use Item
Arun J
|
|
|
|
|
Hi i used itemcommand ,
but i am not getting link
this is my code:
Private Sub dglocal_itemdbound(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dglocal.ItemDataBound
If e.Item.Cells(0).Text = "00:00" Then
Dim hplink As HyperLink
hplink.Text = e.Item.Cells(0).Text
hplink.NavigateUrl = "frmTravelExpDetails.aspx"
e.Item.Cells(0).Controls.Add(hplink)
End If
End Sub
whats wrong in that?,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
Compare with this,
protected void dGrid_ItemDataBound(object sender, DataGridItemEventArgs e)<br />
{<br />
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)<br />
{<br />
HyperLink hypLink = new HyperLink();<br />
hypLink.Text = e.Item.Cells[0].Text;<br />
hypLink.NavigateUrl = "Default.aspx";<br />
e.Item.Cells[0].Controls.Add(hypLink);<br />
}<br />
}
Arun J
|
|
|
|