Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UserControl hosted in browser problem.

Status
Not open for further replies.

AnNguyen

Programmer
Jul 18, 2002
33
0
0
US
Hello everyone.

I created 2 windows control library UC1, UC2. They are both hosted in browser (IE). It's Ok to run each of them separately by typing http//localhost/UC1.html or http//localhost/UC2.html. I wonder is it posible to launch UC2 from UC1, let say i put a button on the control UC1 and when user click this button, it will launch the UC2 the same way as you type the 2nd link in the Ie address bar.
I google on this problem but can not find anything. any help would be much appreciated.

Thanks.
 
Thank you chmohan , unfortunately it didnt work.

Here my code

private void btnlaunchIE(object sender, System.EventArgs e)
{
try
{
System.Diagnostics.Process.Start("IExplorer.exe"," }
catch (Exception e1)
{
txtRemarks.Text = e1.ToString();
}
}

and txtRemarks show this error

System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, PermissionToken permToken)
at Microsoft.Win32.NativeMethods.ShellExecuteEx(ShellExecuteInfo info)
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at EBEctrl.UserControl1.btnlaunchIE(Object sender, EventArgs e)

The above code run correctly in a windows application but my is a user control hosted in the IE.
any ideas of how to set security permission

Thanks.

}
 
I found a solution ( at least for me) and here what i did

1. go to Controlpanel/admintools/
2. Open ms.net framework config
3. expand Machine/codegroup/all_codes/
4. right click LocalIntranet_Zone then click properties.
5. in membership condition Tab set the first combobox to URL and type or your webserver/*
6. in Permission Set TAB set the permision to fultrust.
7. click OK to save the change and restart the web server. And Voila it works.

Hope this will help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top