window.open with ASP.net - asp.net

In my Asp.net application am trying to display files from the hyperlink, the hyperlink is inside of GridView and my script is
View Attachment
the value for this Url is like , localhost:1010/Attachments/test.jpg
when I click this link, it displays the image in a new window, no problem.
But my application page displays only the "[object]",nothing there except this.
am facing this problem only with IE, in chrome its showing perfectly...
how can I fix this, can anyone help me here...

I've found in IE9 that by setting the return reference from window.open to a variable, the behavior you describe will be prevented from occuring.
View Attachment

Related

ASP.NET Web Forms - Button not working inside <iframe> in IE9 and below

I have an ASP.NET Web Forms page that has a form in it and I load it in an <iframe> as a popup.
In all modern browsers it works great.
In IE9 and below, however, things are weird.
One file input element failed to open the file selection dialog when clicking on its browse button.
After fixing this (with a JS trick), I saw another problem. Another button inside the form with this attribute for postback:
onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("btnUpload", "", true, "", "", false, false))"
..failed to invoke the code behind.
When the page loads, it hits my OnLoad() method on the server.
I have searched the whole web trying to find a solution and I have seen others having JS problems inside iframes, but nothing seemed to help.
Does anyone have any idea what may be wrong here?
This is clearly an IE9 problem, but how can I solve it?
UPDATE:
After a few tries, I get an "Access Denied" during the form post, while I shouldn't (It is on the same domain and access should and is allowed).
UPDATE2: I have searched stuff about X-FRAME-OPTION : x-frame-option SAMEORIGIN and clickjacking in ASP.NET but doing this in my Application_BeginRequest doesn't seem to help:
HttpContext.Current.Response.AddHeader("x-frame-options", "SAMEORIGIN");
Related questions:
Get Error WebPage Access is denied in IE
UPDATE3: OK. The access denied is because I send the click to the file input by JS. IE doesn't like it. The mystery of the Browse button not working remains. Perhaps it is a Telerik problem spread to ASP.NET controls: http://www.telerik.com/forums/browse-button-doesnot-workin-ie8#rGGhp26Lm02afXkJNMwQ3g
OK. I have finally solved this one by using the RadUpload instead of the normal Upload ASP.NET control.

Redirecting users to the same Tab in IE in ASP.net

I am redirecting users to a page based on the value I picked from the dropdown.
Response.Redirect("showdetails.aspx?id="+ id);
It is working absolutely fine.
Everytime the user selects an iD it is opening a new tab or page instead of opening in one page.
How can I make sure that it opens in same page instead of opening multiple pages?
Thanks
[Edited due to rethinking]
What you are describing doesn't seem like normal behaviour.
Does the same thing happen on more than one client PC?
If not it's probably a local config issue.
...or...
is the ASP page called via a server-side control with the following attribute:
OnClientClick=”aspnetForm.target =’_blank’
If so, that's why.

New .aspx page in Visual Studio Web Application crashes page

i'm having a WebPart for displaying information about employees and i want to display only a view information about the persons. The rest should be available after clicken on a "more" link. I tried to get that with opening a "popup"window.
But i don't get that to work right. So i tried using a new page. Hence i added a new aspx page to my project in visual studio
and added a link to that page like that:
LinkButton link = new LinkButton(); link.Width = Unit.Pixel(20);
link.Text = "more";
After building the project i tested it in my webpart page and get an error
"An unexpected error occured".
It took me a lot to get the webpart work properly again.
Has anybody an idea what i'm doing wrong. (i also tried to catch an exception without success)
I also tried to add an click event to that "more" link. but then, when i hover above that link with the mouse i see
"javascript:__doPostBack('ctl00$m$g_84d91faf_d0a8_4587_bb7c_712030d2c4ea$ctl00$ctl18','')"
i tried with link.OnClientClick and link.OnClick, nothing works.
I really need that function for that page.
I would highly appreciate it if you can give me a code snippet of a solution.
Thanks in advance
You should use PostBackUrl property of linkbutton Or on button click event you can call Response.Redirect

First deployment, ASP.net image buttons not showing when page is first loaded

I finally got my site to work on my server, and it is now visible at http://www.mhn.co but when you click on any of the categories on the top it loads a professional's profile, but the image buttons I'm using like tabs on the profile content don't load, and just display "Submit Query" until clicked on, then the images load. This is my first asp.net site that I've deployed so I'm pretty unfamiliar with how this should work. The server is running asp.net 2.0, 3.0, and 3.5, and my site is using 2.0
Are you assigning image on load ? Cause the src is null or empty at first. And on the click
you probably added the image on postback or something.
before click :
src = "";
after click
src = "./css/img/content_tab_profile_rollover.jpg"
Try adding image on the load
It's not a problem with the server. It's a problem with the markup or control you're using. Because if you look at the image URL it's trying to use when it first loads it's "http://www.mhn.co/profile.aspx?name=Mounir". But then when you click it works because it points to "http://www.mhn.co/css/img/content_tab_profile_rollover.jpg".
Without seeing your code/markup we can't really do much more. But that is where I'd look

Has anybody had any experience with getting Uploadify file uploader to work within an asp.net updatepanel

I'm having problems getting Uploadify to work in an ASP.NET UpdatePanel. I'm not getting the "Browse" button displayed and so am unable to select any images for update.
It works perfectly outside of the UpdatePanel proving I have hooked everything up correctly.
Any Ideas ?
check the URLs are correctly formatted:
/uploadify/Uploader.ashx
try with
uploadify/Uploader.ashx,
Without seeing any code the first thing that pops up in my mind is, is you ClientIDMode set to Static?

Resources