|
Hi,
I have one query plzzz help me.
http://www.indiafirstlife.com/web/media/press-coverage
when i go this URL and click on this link-- IndiaFirst Serve Maharashtra State Customers - Sunskruti
then one pdf open. But problem is that my client is saying to me pdf should open by name itself only not by the whole url.
Means suppose we have one pdf name as Test.pdf, then we click on link then it should be name Test.pdf not like that---
http://www.indiafirstlife.com/downloadPDF/PressCoverage/Test.pdf-Windows Internet Explorer
in blue bar of opening page.
|
|
|
|
|
Did you notice the last three words in that part of the display? This information is the title text and is displayed by the application itself, in your client's case Windows Internet Explorer.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
what to do.....have u any code that i can solve this issue?
|
|
|
|
|
Solve what? Explain to your client this is IE, nothing to do with your website.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
In this case you can change the file open process. If you tweak your file download script cleverly then the file will be directly downloaded or opened with the associated PDF reader file. File opening with associated application will give another benefit. It is really disturbing for me when I try to open a file and it open in the current page
|
|
|
|
|
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi all,
I am using javascript in my coding, i am using a window.open to open the another link but instead i want open the link in same page and also i am using iframe.
How can i do it ?
Thanks in advance.
modified 24-Jan-12 2:18am.
|
|
|
|
|
Don't ask for Urgent help, it is very rude. This is a volunteer site and people will answer you on their time, not yours. Asking for Urgent help will more likely get you ignored.
No comment
|
|
|
|
|
Petty down-voting gets you even fewer responses.
Good luck.
BTW, this is VERY easy to solve.
No comment
|
|
|
|
|
window.location
And FYI, it is unnecessary to state that your issue is urgent. It might even be viewed as offensive.
|
|
|
|
|
Hi,
I have a PhoneSearch textBox in UserControlA. I want to disable or do not show it. The usercontrolA is being used in another UserControlB and finally the UserControlB is being used in a Test.aspx page. Now when I load the Test.aspx page and when I type in the PhoneSearch textBox the text disappear for the first time. I think some how there is a little page refresh is taking place in the first 3 to 5 seconds. But if I wait for first 5 seconds and then type in then the text stays in the SearchTextBox. So my idea is disable or do not show the Searchtextbox for the first few seconds and I think that may be the solution for page refresh issue (please mention if there is another way we can fix this and code snippet). I am not sure why there is a page refresh is taking place when the page loads of the first time.
Just as a side note the UserControlA and UserControlB both are inside an update panel and test.aspx is using a master page.
I am trying to use the below code in the userControlA as below but no luck
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Test.ascx.vb" Inherits="...Test" %>
<asp:UpdatePanel ID="SearchUpdatePanel" runat="server" RenderMode ="inline" UpdateMode="Conditional">
<ContentTemplate>
<asp:TextBox ID="PhoneSearch" TabIndex="5" runat="server" Width="160px"/>
<<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$('<%= PhoneSearch.ClientID%>').show();
alert('<%= PhoneSearch.ClientID%>');
});
</script>
</ContentTemplate>
</asp:UpdatePanel>
I get ctl00_DefaultContent_UserControlB_UserControlA_SearchTextBox in my alert box and the $('<%= PhoneSearch.ClientID%>').show(); doesn't show the text box. Can some one help me with this?
Thanks in advance,
L
modified 17-Jan-12 6:07am.
|
|
|
|
|
How are you hiding the text box in the first place? There is no style information applied to it that I can see there.
jQuery will have some method of doing show/hide, which I suspect is assigning to (object).style.display. If the ASP rendering is hiding the control by doing something different, jQuery won't be able to show it. You need to either work out what ASP.net is doing and write script to reverse that, or hide it using some markup that jQuery (or simple clientside script) can easily change.
I recommend the second way:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Test.ascx.vb" Inherits="...Test" %>
<asp:UpdatePanel ID="SearchUpdatePanel" runat="server" RenderMode ="inline" UpdateMode="Conditional">
<ContentTemplate>
<div id="<%=SearchUpdatePanel.ClientID%>_TextBoxDiv" style="display:none">
<asp:TextBox ID="PhoneSearch" TabIndex="5" runat="server" Width="160px"/>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
document.getElementById('<%= SearchUpdatePanel.ClientID%>_TextBoxDiv').style.display = '';
});
</script>
</ContentTemplate>
</asp:UpdatePanel>
I'm not sure if there's an asp:Container or something which is a server-side div that prevents the slightly ugly ID related hackery there, but the principle should be the same.
|
|
|
|
|
Hi Bob,
Thanks for post. I am sorry I forgot to mention that I am setting my PhoneSearch text box disaplay to non as you see below but forgot to include the above code.
<asp:textbox id="PhoneSearch" tabindex="5" runat="server" width="160px" style="display:none">
I have tried your idea of putting it in a Div and also with out Div just setting the text box to display none and below is the code I have right now
<script type="text/javascript" language="javascript">
$(document).ready(function () {
document.getElementById('<%= PhoneSearch .ClientID%>').style.display = '';
});
</script>
in either case what it is doing is it first shows the Textbox for few seconds and then disappear. I think I am almost there but I believe some thing to do with the styling to make it show and do not disappear.
Thanks,
L
|
|
|
|
|
As an alternative I am also trying to use setTimeout but it doesn't seem like it is doing any difference.
<script type="text/javascript" language="javascript">
$(document).ready(function () {
setTimeout(function(){
document.getElementById('<%= SearchDoctor.ClientID%>').style.visibility=visible;
},500);
//alert('<%= SearchDoctorPanel.ClientID%>_TextBoxDiv');
//document.getElementById('<%= PhoneSearch .ClientID%>').style.display = 'show';
//document.getElementById('<%= PhoneSearch .ClientID%>').style.display = '';
//document.getElementById('<%= SearchUpdatePanel.ClientID%>_TextBoxDiv').style.display = '';
});
</script>
any inputs on this as well?
Thanks,
L
|
|
|
|
|
The relevant values for the .display style are "none" for not shown, and "inline" or "block" to show it again. "inline" is for elements that exist on the same line as text and "block" elements take up the whole width of the containing element, unless you set their width, make them float, etc.
The "visibility" attribute is less useful - I would stick to .display = 'none' and .display = 'block' .
|
|
|
|
|
Setting display to the empty string means that the element gets its default display style, which will be inline or block but you don't need to know which. Showing and hiding things by setting their style.display to either 'none' or empty definitely works, I do that a lot.
|
|
|
|
|
If it appears after that code is run, and then disappears, make sure you're not setting the style back somewhere else. If you're setting it in the update panel code behind then every time that control is re-rendered it will come as display:none, and document.onready is not called when an AJAX response is handled.
If you want it to be shown immediately, sometimes, you need to write your control in such a way that it renders it correctly, i.e.
<asp:TextBox ID="PhoneSearch" TabIndex="5" runat="server" Width="160px" <%= (some expression) ? "style=\"display:none\"" : "" %> />
... where (some expression) is however you determine whether this box should be shown.
You probably still want to render it inside a div on which you do the visibility logic, because you probably want to have some text or something as well as the text box which should all be switched together.
|
|
|
|
|
Bob, I am running out of ideas on how to code using this approach
<%= (some expression) ? "style=\"display:none\"" : "" %> />
can you please help me with some code snippet?
|
|
|
|
|
Well you showed some code yourself using <%= ... %>; that just causes the ASP.net renderer to output something. There must be some expression which you use to determine whether the text field should be displayed in the rendered control when it is requested, unless you want it to either always be hidden or always shown when the page segment is loaded (remember, you're putting it in an UpdatePanel, so this includes whenever that panel is updated).
If you're not familiar with the ? : syntax I suggest a quick visit to the documentation[^] (or if you have some books on any C family language you can find it in there too).
|
|
|
|
|
The ? : syntax can't be used with VB.net, which is the language the OP is using. Instead, the OP would use the If (condition, option1, option2) syntax.
|
|
|
|
|
Oh, good catch, I missed that. I've just been spending a month writing a C#-based ASP.net website and forgot about the existence of VB.
|
|
|
|
|
I am not sure if I understand it right what you have said. Can you please re frame your idea?
Yes I am using vb.net but not sure what you mean and what you want me to suggest to use or code how?
|
|
|
|
|
First, you should check if you really are getting a postback. Put this in your update panel:
<%= Page.IsPostBack.ToString()%>
It could be that you have some JavaScript that is clearing the textbox on page load. Or the textbox is re-getting focus on page load and you are typing over what is already in the textbox.
|
|
|
|
|
Hi,
The idea of putting <%= Page.IsPostBack.ToString()%> on my usercontrol helped me realize that it is not the issue with the Text disappearing in the textbox. But the issue is that the page is getting post back twice and that is why the text in the text box is disappearing.
When page is loaded for the first time the value of <%= Page.IsPostBack.ToString()%> is False and in few seconds a page post back is taking place all by itself and the value is true.
I couldn't figure out what is causing the second post back yet. But when I searched online I found that there could be two reasons for posting back twice.
1) It may be because of any client side scripting either java script or jQuery that may be causing the post back. In my case I do not see any client side that is written to cause a post back.
2) The other reason for the second time post back could be that if any Image tags are used and then if no src attribute is provided then this might also cause a post back.
In my case, we are using a default.master and I see quite a few <asp:image> tags are defined in the master page and I do not see either src or imageurl attribute being used in them. I just see that a skinID is being used.
I am not sure if I need to use imageurl in all of my <asp:image> tags to fix the page post back issue
Does any body have any inputs?
Thanks in advance,
L
|
|
|
|
|
Wow, that is crazy. I would never have suspected that an empty src attribute in an image control could possibly cause a double postback. However, from what I read online, it is indeed possible.
I recommend using something like Fiddler2 to intercept the HTML that the ASP.net gets rendered to. That way, you can search for all the image tags and see if any have strange src attribute values.
Also, you might want to try disabling JavaScript in your browser. That way, you can exclude the possibility that there is any JavaScript causing the postback.
|
|
|
|