Has any one converted a ASPX to ASCX that has client side javascript functions. For Example:
It is very hard to find client side scripting support online, and off line for asp.net.
Problem:
The Forum is a great application, but I would love to use it other applications.
I'm trying to convert the /Forums/Default.aspx to /Forums/Default.ascx
and also /Forums/Postmessage.aspx to postmessage.ascx
I was successful at getting all of the Modules including the Forum to run in the IBUYSPY Portal environment with the exception of the Javascript functions located on the ASPX pages mentioned above.
** The entire forum runs very well with exception of the Delete Functions and the InsertTag Function.
I have converted the Delete function as follows
<code>
<!--<script language="javascript">
function DeleteForum(id)
{
if (confirm('Are you sure that you want to delete this forum and all its discussions?'))
{
document.forms['Default'].elements['_ctl0:paramId'].value = id;
__doPostBack('DeleteForum', '');
}
}
function DeleteCategory(id)
{
if (confirm('Are you sure that you want to delete this category and all its sub-forums?'))
{
document.forms['Default'].elements['_ctl0:paramId'].value = id;
__doPostBack('DeleteCategory', '');
}
}
</script> -->
</code>
**Note: I do not have form tags on the user controls
Default is the form Id on the DesktopDefault.aspx page. _ctl0 is the name of the user control with the (server control ParmID) on the user control Default.ascx
** Note: The user controls doesn't have form tags.
I'm not getting any errors.
The popup box comes up with the choices (OK or Cancel) but after clicking (OK) the page just refreshes with no delete.
I will post a copy of the converted forum notes when its finish to this forum to share with all.
The PostMessage Javascript Function:
<code>
<!-- <script language="javascript">
function InsertTag(tagcode)
{
document.forms['Default'].PostMessage.Message.value += tagcode;
}
</script> -->
HOW DO I CONVERT THESE FUNCTIONS and what changes if any to the code must take place?
ASP.Net doesn't have much info on accessing DOM objects in script. All help is appreciated
