jskfan
asked on
open dialogbox in ASP.NET
I am using this code below so that i can open a dialog box and select a folder from a drive, and make the folder name and path show up on the text box in the web form, but it doesn't open the dialog box.
Any idea?
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Button6.Attributes.Add( "OnClick", "ShowDialog();")
End Sub
thanks
Any idea?
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Button6.Attributes.Add(
End Sub
thanks
ASKER
<<<<<<<<<Me.Button6.Attrib utes.Add(" OnClick", "ShowDialog();")
move this into Form_PreRender event>>>>>>>>>>>>.
it still doesn't do anything
move this into Form_PreRender event>>>>>>>>>>>>.
it still doesn't do anything
try this in page_load................. ....
May i see the code in ShowDialog() ?
May i see the code in ShowDialog() ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the goal is to open a dialog box and select a folder name in the network drive
Hi jskfan,
you cannot open a network drive with a browser unless it is mapped. This is a security issue.
regards
I
you cannot open a network drive with a browser unless it is mapped. This is a security issue.
regards
I
Hi jskfan,
Here is a sample of open folder dialog but you have to set permissions accordingly.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
<!--
function t()
{
var WINDOW_HANDLE = 0;
var OPTIONS = 0;
var objShell = new ActiveXObject("Shell.Appli cation");
var objFolder = objShell.BrowseForFolder(W INDOW_HAND LE, "Select a folder:", OPTIONS, "C:\\");
if(objFolder== null) { Wscript.Quit() ; }
var objFolderItem = objFolder;
var objPath = objFolderItem.Path;
document.write(objPath);
} // end function
//-->
</SCRIPT>
</HEAD>
<BODY onclick="t();">
Click me
</BODY>
</HTML>
regards
I
Here is a sample of open folder dialog but you have to set permissions accordingly.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
<!--
function t()
{
var WINDOW_HANDLE = 0;
var OPTIONS = 0;
var objShell = new ActiveXObject("Shell.Appli
var objFolder = objShell.BrowseForFolder(W
if(objFolder== null) { Wscript.Quit() ; }
var objFolderItem = objFolder;
var objPath = objFolderItem.Path;
document.write(objPath);
} // end function
//-->
</SCRIPT>
</HEAD>
<BODY onclick="t();">
Click me
</BODY>
</HTML>
regards
I
ASKER
ivostoykov ,
where do you want me to paste this HTML code above?
I need a click button that browse through the drive folders
where do you want me to paste this HTML code above?
I need a click button that browse through the drive folders
Hi jskfan,
sorry for the delay but i was out for a wahile...
1. Add script as a standard script block into the header
2. attach finction to desired object, i.e.
Me.Button6.Attributes.Add( "OnClick", "t();")
regards
I
sorry for the delay but i was out for a wahile...
1. Add script as a standard script block into the header
2. attach finction to desired object, i.e.
Me.Button6.Attributes.Add(
regards
I
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry, I am using ASP.NET and could not get your code to work
Hi jskfan,
The code is indeed for asp.net
The button3_click subroutine executes and displays the cotents of open file dialog in a textbox .
I am using this code in an ecommerce ASP.NET web application. And it's working.
The code is indeed for asp.net
The button3_click subroutine executes and displays the cotents of open file dialog in a textbox .
I am using this code in an ecommerce ASP.NET web application. And it's working.
ASKER
skvikram ,
that was excellent!!!
1-I didn't know that you can put sub procedure in the HTML page, I did and it run just good.
2-Can the open dialog box pickup a folder instead of a file? if it is not incovenient for you can you show me how to do it?
Thanks a lot!!!!
that was excellent!!!
1-I didn't know that you can put sub procedure in the HTML page, I did and it run just good.
2-Can the open dialog box pickup a folder instead of a file? if it is not incovenient for you can you show me how to do it?
Thanks a lot!!!!
ASKER
In other words, can you please take a little bit more of pain to explain your code?
thanks
thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> Me.Button6.Attributes.Add(
move this into Form_PreRender event
HTH
I