|
Start by taking out the javascript: protocol from your script registration:
ScriptManager.RegisterStartupScript(this, this.GetType(), "openPDF", "window.open('../../Service/Pages/Page2.aspx');", true);
That should get rid of the script error.
You'll then see a warning from the popup blocker in your browser, since your script is trying to open a new window, and it's not in direct response to the user clicking something on the page.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The Javascript opened the page2 if i commented the line of the
response.redirect to page3
but If I left it like that..
It goes to the page3 (response.redirect)
without opening page2 in the new tab (the register Javascript line)
|
|
|
|
|
Yes, a Response.Redirect will throw away all of the page content, and instead tell the browser to load a different page.
You'll need to remove the server-side redirection, and send back some script to redirect the page on the client:
ScriptManager.RegisterStartupScript(this, this.GetType(), "openPDF", "window.open('../../Service/Pages/Page2.aspx');", true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect", "location.assign('../../Service/Pages/Page3.aspx');", true);
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
This is working great in chrome ..
but in IE it is always blocked and I need to disable the Pop up blocker.
is any work around to avoid that in IE ?,
And Really Thanks and appreciate your help
|
|
|
|
|
No, there's no way to circumvent the popup blocker. If there was, it wouldn't be much use!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Damn, I just realised why my web dev looks at me funny when I ask him to use dialogs, in Silverlight they are just like a desktop dialog but I guess they are a popup window in ASP/MVC.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks alot ..
but the issue is
when the submit button is gone.. it is gone.. even the user allowed the pop up
the first page is redirected to page3 but the page2 is never opened in a new a tab.
and Page2 is actually a pdf document to be downloaded.. so I could never be able to download it .. in IE
Unless the popup block is not blocking me..
|
|
|
|
|
Hey all,
If I'm on MachineA and remote into MachineB using Terminal Services (remote desktop / mstsc.exe), is it possible for a process that's then launched on MachineB to tell that the user is actually connected from MachineA?
I suspect it's possible, as Task Manager's Users tab can show User/ID/Status/Client Name/Session. What I'm after is Client Name.
|
|
|
|
|
|
Try this[^]. Not sure if it works and not able to give it a try atm, but a bit Googling pointed in that direction.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
This jumps through a lot of hoops to determine the name of the machine the code is running on. What I'm after is the name of the machine the user is remoting from.
Local/remote in this context gets confusing. I'm on OfficePC. I use Remote Desktop to log into ServerMilesAway. I run my app. My app knows (Environment.MachineName) it's running from ServerMilesAway, and I can log that and whatever. But I want my log to also show that the user who launched my app is actually back on OfficePC (not the user's name, which I can already get, but the machine name that started the remote session).
Task Manager can do that. I'd like to be able to do the same.
|
|
|
|
|
Holy crap.
ECHO %CLIENTNAME%
This variable only seems to exist from within RDP sessions.
That'll do.
[Edit] This is the case on Windows 7, but it's still not there on Windows 10. WTF?
[Edit #2] If anyone cares:
Don't know why Microsoft took it out. But the session ID (an int) can be obtained from GetCurrentProcess().SessionId. Once I have this ID, I can go to HKEY_CURRENT_USER\Volatile Environment[SessionID]\CLIENTNAME. That seems to work consistently.
I'm not a huge fan of this solution, but it works so far...
modified 17-Feb-16 16:58pm.
|
|
|
|
|
I want to change the gliphicon button when pressed to show password and then after pressing it again get it back again?
|
|
|
|
|
Permission granted. Please, proceed.
Or did you forget to say what part of that you were having a problem with?
|
|
|
|
|
You can't just give him permission to proceed like that!
He hasn't even got a form 37/B/14 countersigned by Accounts yet!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Crap. I forgot, it's all about the red tape!
|
|
|
|
|
I have a file copy app. I need to determine if the app is running in-house (over the LAN) or is the client running remote.
What's the best way to determine this?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
We usually query the domain name of the current logged in user.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
That'll work...
Thanks!
If it's not broken, fix it until it is
|
|
|
|
|
I'm getting back the Machine Name of my dev PC. What about using Workgroup name?
If it's not broken, fix it until it is
|
|
|
|
|
As long as it is not named "workgroup"..
Wouldn't use it as a security-feature though.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I'm not sure I fully understand the question. From the perspective of your app, what criteria establishes it "running remote"? Different domain (as has already been suggested), different subnet, different AD server, or something else altogether? Or just "any" remote machine (in which case SystemInformation.TerminalServerSession might do)...?
Incidentally, I came here to ask a similar (but not identical). As I don't want to hijack your thread, I'll start a new one...
|
|
|
|
|
dandy72 wrote: what criteria establishes it "running remote
Either the user is sitting in the office attached (either wired or wireless) to the LAN, or is outside the office not connected to the LAN. If someone where to remote in then they would by nature be "on the LAN".
For example, if I installed the app onto my laptop and was using it at the office I would plug into the LAN and be connected "in office".
Now I go home and take my laptop with me. I connect to my wireless through my router and my IP provider, so now I'm actually "remote".
What it comes down to is this - can I copy a file to the network, or do I need to FTP it in?
If it's not broken, fix it until it is
|
|
|
|
|
Sounds to me like you just need to verify whether the machine you're trying to copy files to is reachable at all or not...no?
If you can reach a file share, then you're all set...otherwise, fall back to FTP, or whatever other mechanism you'd normally use under those circumstances.
Do you need to take any special consideration if you're connected via VPN?
|
|
|
|
|
dandy72 wrote: Sounds to me like you just need to verify whether the machine you're trying to copy files to is reachable
Exactly. I had thought of trying
string AppFolder = @"P:\somefolder";
bool isOnLan = Directory.Exists(AppFolder);
But what if someone who was NOT really connected created a mapping with the same name.. then my app no longer works.
I think I need a more reliable way.
As far as VPN.. I hadn't thought of that.
There's got to be a way to identify the network I'm physically attached to.
If it's not broken, fix it until it is
|
|
|
|