|
Thank you so much ..
|
|
|
|
|
I have the following situation in an ASP.NET web application.
A parent aspx page has a usercontrol that has a button (say B1). A click of this button causes another aspx page to open in a pop-up via javascript in a .js file associated with the parent page (i.e window.open("........")).
The pop-up comes pre-populated with data retrieved on page_load of pop-up.
The pop-up has a button (say B2) which when clicked sends an email (to a valid address) via javascript-webservice. The button click is bound to a javascript method which has a webservie call, to which all necessary data is passed. After the B2 click the popup closes.
Now problem:
B1 click: Popup opens, B2 click : Mail is sent, Popup closes.
B1 click again: Popup opens, B2 click : Mail is sent, Popup closes.
B1 click again: Popup opens without content, just freezes up.
Work Around:
If window.close() after the Webservice call is removed and the pop-up is left open, n no. of B1 clicks sent mails successfully. Any closing of the popup immediately after B2 click followed by an immediate B1 click causes the system to hang.
SOS
|
|
|
|
|
Its difficult to make a guess without looking at the code.
Could you please post your code where you call the web service.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Is there a good reason for calling webservice from a JS? The best way to solve JS errors are to use FireBug and analyze the JS.
I would use a different method in this case rather than using JS to call web-service,
1) B1 click: Popup opens,
2) B2 click : A new thread is started in which web-service call will be executed.
3) Emit JS to close the popup to the response.
|
|
|
|
|
just Past ur code thats why I can find out solution
|
|
|
|
|
I even tried that.
The method in Business Logic that sends mail is a public static method which calls Smtpmail.Send(). Here visibly the call halts till the mail is send.
I tried then with Smtpmail.SendAsync(). Here the debugger passes the Async immediately and returns to the WebService but does not return to the javascript (I tried also by preventing immediate closure of the window).
Here is something similar:
function InWebService()
{
// Code that gets some values from hidden fields etc.
XYZFullyQualifiedNamespace.MailWebService.SendNotifyMail(//All Parameters,OnSuccess,OnFailed)
window.close(); // Also worked with commenting it.
}
function OnSuccess()
{}
function OnFailed()
{}
//-------------------------
Webservice
[WebMethod]
public bool SendNotifyMail(//All required Paarmeters)
{
// Code
bool isSent = MailBusinessLogic.SendMail(//All required Paarmeters);
}
//-------------------------
MailBusinessLogic
public static SendMail
{
// Smtp preparation, Port, Server, bCC, cc etc
objSmtp.SendMail(objMsgBody); // <= OPERATIONAL LINE [OL]
}
I changed [OL] with
objSmtp.SendMailAsync(objMsgBody,stringObject);
Then tried starting a new thread in a new method and delegating a non-static version of SendMail to it. But to no avail. This problem seems all too powerful.
//
GIST:
If the window is left open the mails can be repeatedly sent. If closed, it cannot be sent after 2nd time, the window freezes. Also I noticed that on third send with the window open, there is a small lag as though its waiting for the thread to return or something.
--- Thanks for the concern Navneet.
P.S. The peculiar setup of functionality is courtsey the client's wet dream
Best Regards
|
|
|
|
|
I want to create my own website such as www.abc.com in asp.net and want to make it live.
Do I need to purchase some license to create it?
if yes than how coslty it is?
Please suggest..
Thanks in advance!!
Gaurav
|
|
|
|
|
G.K.M. wrote: Do I need to purchase some license to create it?
if yes than how coslty it is?
You need to buy a domain name (i.e. www.abc.com) and a hosting plan. This should not be very expensive.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
G.K.M. wrote: Do I need to purchase some license to create it?
You may need to get a licensed version of Visual Studio to program.
|
|
|
|
|
No, there are no restrictions on the use of express editions.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yes. I forgot about express editions.
|
|
|
|
|
i am using ajax calender extender control.in my page i place textbox and calender extender control and dropdowndown controls.i select one date from extender it display to textbox .but when i select a item from dropdown the page refreshed .the textbox value is missing.plz help???
|
|
|
|
|
J.Vinod wrote: but when i select a item from dropdown the page refreshed .the textbox value is missing.plz help???
Its because Dorpdown box having Postback Enabled and while you are chaging the item from drop down its postback the whole page.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hello,
I have developed an app that allows users to upload asp files to a webserver, and would like to have them play dynamically. Does anyone have any suggestions as to how to make this happen? I have tried ASPNet Audio and PseudoMP3, but neither work.
|
|
|
|
|
dboy221 wrote: I have tried ASPNet Audio and PseudoMP3, but neither work.
Well, odds are very good that they work and you just can't work out how to use them.
There is no way ASP.NET can play an mp3. you need an activeX, java or other plugin to do that. So, you need to choose a plugin, and stick with it until you can work out how it works, perhaps asking for help on the forums of the people who provide it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi All,
I have an asp ImageButton within a gridview. Normally, I click the button, and the row upon which the button is in, is deleted.
It worked well for a long time, until one day it didn't.
I have spend exactly 12 hours now trying to work out what has happened, and I have found the problem.... I just don't know how to solve it.
The problem comes from me having added a custom control to the page.
I registered the control like this:
<%@ Register TagPrefix="user" TagName="AddressForm" Src="UserControl/AddressForm.ascx" %>
The control is pulled into the page like this:
<fieldset style="margin-left:10px;margin-right:10px">
<div class="cart_spacer"></div>
<legend><span style="color:#c90101;font-size:12px; font-family: Arial, Helvetica, sans-serif">Shipping Address</span></legend>
<div style="padding:5px 5px 5px 5px" class="productSubHeading">
Enter the address where you would normally want your order shipped. <br /><i class="cart_small">(this can be changed whenever you place an order)</i>
</div>
<div class="cart_spacer"></div>
<user:AddressForm
id="shippingAddress"
ShowCopyCheckBox="False"
CopyCheckBoxText=""
Runat="server" />
</fieldset>
The Gridview looks like this:
<asp:GridView ID="grd_Cart" runat="server"
AutoGenerateColumns="False" Width="100%"
OnRowDataBound="grdCart_RowDataBound"
DataKeyNames="TempDetId"
DataSourceID="sqlGrdCart"
GridLines="None"
BorderColor="#CCCCCC"
BorderWidth="1px"
BorderStyle="Solid"
AlternatingRowStyle-BackColor="#F2F2F2"
HeaderStyle-BorderColor="#CCCCCC"
HeaderStyle-BorderStyle="Solid"
HeaderStyle-BorderWidth="1px"
EmptyDataText="There are no items in your shopping cart"
>
<Columns>
<asp:BoundField DataField="TempDetID" Visible="false" ShowHeader="false" />
<asp:TemplateField>
<ItemTemplate>
<a href="ShowImage.ashx?img=<%#Eval("SwatchImage")%>&path=BlindsImages" class="lboxImg">
<img src='ShowImage.ashx?img=<%#Eval("SwatchImage")%>&h=30&w=30&path=BlindsImages' title="click for larger image" width="40px" style="text-align:center" alt='<%#Eval("SwatchImage")%>' style="border:0px;" /></a>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description" HeaderStyle-CssClass="headerstyle" HeaderStyle-HorizontalAlign="Left" ShowHeader="true" HeaderStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:Label ID="lblDesc" runat="server" style="padding:5px 5px 5px 5px" Width="270px" text='<%# Eval("LineDesc") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Qty" HeaderStyle-Width="30px" HeaderStyle-HorizontalAlign="Center" ShowHeader="true">
<ItemTemplate>
<asp:TextBox ID="txtQty" runat="server" alt='<%# Eval("TempDetId") %>'
AutoPostBack="false"
onchange="CheckPostBack(this);updateQty(this.alt,this.value)" style="padding:5px 2px 5px 2px; text-align:center" width="30px" Text='<%# Bind("Qty") %>'></asp:TextBox>
<asp:RangeValidator ID="valQty" Type="Integer" MinimumValue="1" MaximumValue="1000" ControlToValidate="txtQty" runat="server" ErrorMessage="*"></asp:RangeValidator>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="30px" />
</asp:TemplateField>
<asp:BoundField DataField="OrigPrice" HeaderText="Price Each" ItemStyle-Font-Strikeout="true" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px" DataFormatString="{0:C}" HtmlEncode="false" SortExpression="OrigPrice" >
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle Width="50px" />
</asp:BoundField>
<asp:BoundField DataField="SalePrice" HeaderText="Web Price" ItemStyle-ForeColor="Red" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px" DataFormatString="{0:C}" HtmlEncode="false" SortExpression="SalePrice" >
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle Width="50px" />
</asp:BoundField>
<asp:TemplateField HeaderText="Delivery or Installation?" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
HeaderStyle-Width="80px" ItemStyle-Font-Size="10px" ShowHeader="true">
<ItemTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Label runat="server" ID="lblDelType" style="padding:5px 2px 5px 2px; text-align:center" Width="100%" Text='<%# Eval("DelType") %>'></asp:Label>
</ContentTemplate>
<Triggers><asp:AsyncPostBackTrigger ControlID="butPostBack" EventName="Click"/> </Triggers>
</asp:UpdatePanel>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" Width="30px" />
</asp:TemplateField>
<asp:TemplateField ShowHeader="false" ItemStyle-Width="30px">
<ItemTemplate>
<asp:ImageButton ImageUrl="images/TrashCan.gif" runat="server" CommandArgument='<%# Eval("TempDetId") %>'
OnCommand="butDel"
CommandName="Delete" ToolTip="Delete / Remove" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
So can anyone tell me why my imagebutton won't fire any code event when this user:AddressForm is on the page? If i remove it from the page but leave the register block in there, it all works fine.
Apologises for posting so much code, I am anticipating that you'll need to see it.
|
|
|
|
|
Put your update panel outside your grid, see if that works. Had similar problem when i used update panel inside a grid.
|
|
|
|
|
Thanks for the info, but I've tried that already during the elimination process.
Besides, the msdn docs show what I've done as an example with Update panels.
http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.aspx
Prior to this problem, I had the whole Grid in an update panel, because I didn't realise you could put an UPan in an item template.
The problem is definately associated with this custom control... if I remove the control, everything works nicely.
|
|
|
|
|
Does this runs? The update panel does not contains any control with ID "butPostBack".
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
yes the button is located elseewhere on the page and is called from js to fire a partial page postback.
|
|
|
|
|
Hello all,
I am using customErrors of Web.config file in my application so that to redirect the user to an error page on exception.
But after getting exception i am not redirecting to the erropage.
Am i missing something?
I am using this code in my web.config:
<customErrors mode="On" defaultRedirect="ErrorPage.aspx">
</customErrors>
|
|
|
|
|
|
I tried couple of things mentioned in the article but i m still not achieving the result.
|
|
|
|
|
I am using VS2005 and installed AJAX Extensions and AJAX Toolkit 1.0.20229.
When i create the AJAX controls from designer file its working fine (the created control is also being referenced in code behind file). But when i try to create an AJAX control from code behind file its not working.
Please help me out in this.
Thanks,
Santa
|
|
|
|
|
Did you imported the namespace of Toolkit ?
Parwej Ahamad
ahamad.parwej@gmail.com
|
|
|
|