Pop up from an email link

Last post 05-26-2008 3:49 AM by Vince Xu - MSFT. 9 replies.

Sort Posts:

  • Pop up from an email link

    05-17-2008, 1:52 AM
    • Loading...
    • BNDIT
    • Joined on 05-10-2008, 11:28 PM
    • Posts 94
    I am working on an webform app in which data error notifications are emailled to users. Each email contains links that pop up a webform for users to enter data corrections. How can a single form pop up from an email link into the browser without url box and status bar? (I have done something similar from a main form using javascript with a modal window but not from an email.) Please advise. Thanks.
  • Re: Pop up from an email link

    05-17-2008, 5:51 AM
    • Loading...
    • anzer
    • Joined on 10-19-2004, 12:00 AM
    • UAE
    • Posts 811
    To show such a pop up, you need Javascript.. but Javascript will not work with most emails.. so I think it will not be possible
    If this post was useful to you, please mark it as answer.

    My Blog | Free books Microsoft
  • Re: Pop up from an email link

    05-17-2008, 6:24 AM

     Hello Dear,

    As for your query ,  the following problem can be solved by Asp.net (ajax) Modalpopup

    wt you have to do is ?

    1) design a Panel  on your page, with server button

     <asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Style="display: none"
                    Width="433px">
                    &nbsp;<table style="width: 389px; height: 167px">
                        <tr>
                            <td colspan="4" style="text-align: center">
                                <strong><span style="font-size: 11pt">Your Details</span></strong>&nbsp;</td>
                        </tr>
                        <tr>
                            <td style="width: 57px; height: 25px">
                                Name<span style="color: #ff0000">*</span></td>
                            <td colspan="3" style="height: 25px">
                                <asp:TextBox ID="txtEName" runat="server" Height="15px" Width="107px" EnableViewState=false></asp:TextBox>&nbsp;
                                <asp:Label ID="lblNameVal" runat="server" ForeColor="Red" Text="*" Width="5px" Visible="False"></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="width: 57px">
                                E-mail<span style="color: #ff0000">*</span></td>
                            <td colspan="3">
                                <asp:TextBox ID="txtEEmail" runat="server" Height="15px" Width="201px" EnableViewState=false ></asp:TextBox>
                                <asp:Label ID="lblEmailVal" runat="server" ForeColor="Red" Text="*" Width="5px" Visible="False"></asp:Label>
                                <asp:RegularExpressionValidator ID="rEVEmail" runat="server" ControlToValidate="txtEEmail"
                                    Display="Dynamic" ErrorMessage="(eg:name@domain.com)" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td>
                        </tr>
                        <tr>
                            <td style="width: 57px; height: 14px">
                                Phone</td>
                            <td colspan="3" style="height: 14px">
                                <asp:TextBox ID="txtEPhone" runat="server" Height="15px" Width="76px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="width: 57px">
                                City</td>
                            <td style="width: 127px">
                                <asp:TextBox ID="txtECity" runat="server" Height="15px" Width="57px"></asp:TextBox>
                                &nbsp;&nbsp;&nbsp;</td>
                            <td style="width: 34px">
                                &nbsp;</td>
                            <td style="width: 100px">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 57px">
                                Country</td>
                            <td style="width: 127px">
                                <asp:DropDownList ID="dpdcountry" runat="server" Width="136px">
                                </asp:DropDownList></td>
                            <td style="width: 34px">
                            </td>
                            <td style="width: 100px">
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="4">
                                <asp:Button ID="OkButton" runat="server" Text="Send" />
                                <asp:Button ID="CancelButton" runat="server" Text="Cancel" /></td>

                        </tr>
                    </table>
                    &nbsp;
                    <br />
                    <div align="center">
                        &nbsp; &nbsp;&nbsp;
                    </div>
                </asp:Panel>

     

    2) Then put a modelpopup control

    And follow this code

    <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
                    CancelControlID="cancelButton" DropShadow="true" OkControlID="cancelButton" PopupControlID="Panel1"
                    TargetControlID="LibuEmail" >
                </cc1:ModalPopupExtender>

     

    3) Put the css code in you CSS file and give link to your page

    .popupControl {
        background-color:#AAD4FF;
        position:absolute;
        visibility:hidden;
        border-style:solid;
        border-color: Black;
        border-width: 2px;
    }

    .modalBackground {
        background-color:Gray;
        filter:alpha(opacity=70);
        opacity:0.7;
    }

    .modalPopup {
        background-color:#ffffff;
        border-width:3px;
        border-style:solid;
        border-color:Gray;
        padding:3px;
        width:250px;
    }
    .updateProgress
    {
        position: absolute;
        background-color: #fff;
        filter: alpha(opacity=70);
        MozOpacity: 0.7;
        opacity: 0.7;
        padding: 0px;
        margin: 0px;
    }
    .updateProgress div
    {
        background-color: white;
        padding: 4px;
        position: absolute;
        top: 10%;
        left: 40%;
    }

    Then double click on the button and write the code as for you requirement

    Benefit  :

    a pop up will generate  on your desire click in fraction of second. and on click of the button of popup ,it generate the server event(menas postback event)

    now where ever you want to show value assign over there

    like textboxonMainPage.Text=textboxonModalPopup.Text

    ======================================
    Regard,
    Pradeep Sahoo
    Sr. Sofware Developer
    Don't forget to click "Mark as Answer" on the post that helped you.
  • Re: Pop up from an email link

    05-17-2008, 7:23 AM

     How can you directly allow a person enter details without validating him?

    In this case you are relying on the authenticity of user data on the security of his email account.

    What you can do is simply redirect him to the form where he needs to fill entries, by giving the url in the email. The user will not be authenticated at the time of click and will be redirected to a login page, over there write a code to retrieve information that what was the last page, and after validation, redirect user again to that page!!

    With this simple logic, you will not need to write such a big code!! Smile

  • Re: Pop up from an email link

    05-17-2008, 9:51 AM
    • Loading...
    • BNDIT
    • Joined on 05-10-2008, 11:28 PM
    • Posts 94
    My app is part of an intranet portal. The data entry form is a tool to make users correct their previous data entries and is intended to be ideally a pop up form instead of a regular form.
  • Re: Pop up from an email link

    05-20-2008, 2:15 AM
    Answer

    1. Using Div with 'posion=absolutely'. When onclick, you can use divId.style.visibility='visible' to show it and use divId.style.visibility='hidden' to hide it. It will be just like a PopUp page without url box.

    HTML Div :

    <div id='divPopupBody' style="position:absolute; visibility:hidden;" ></div>

    JavaScript popup function:

        var obj=document.getElementById(target_controlid);
        obj.style.visibility="visible";

     JavaScript closing popup function:

        var obj=document.getElementById(target_controlid);
        obj.style.visibility="hidden";

    2. Then you can use Ajax to retrieve the content into Popup page.

    var XMLHttpFactories = [
     function () {return new XMLHttpRequest()},
     function () {return new ActiveXObject("Msxml2.XMLHTTP")},
     function () {return new ActiveXObject("Msxml3.XMLHTTP")},
     function () {return new ActiveXObject("Microsoft.XMLHTTP")}
    ];

    function createXMLHTTPObject() {
     var xmlhttp = false;
     for (var i=0;i<XMLHttpFactories.length;i++) {
      try {
       xmlhttp = XMLHttpFactories[i]();
      }
      catch (e) {
       continue;
      }
      break;
     }
     return xmlhttp;
    }

    function GetEmail(url)
    {
        var xmlhttp = createXMLHTTPObject();;
        xmlhttp.open("GET", url,true);
        xmlhttp.onreadystatechange=function()
        {
            if (xmlhttp.readyState==4)
            {
                var responsetext=xmlhttp.responseText;

                document.getElementById('divPopupBody').innerHTML=responsetext;
               
            }
        }
        xmlhttp.send(null);

    }

     <div id='divPopupBody' style="position:absolute; visibility:hidden;" ></div>

    3. In above JavaScript code, the content is retrieved from another page with variable "url". So you need put the email content to this page in order to be retrieved by Div.

    For example, you can use goPopup("page.aspx") to call the function. Before that, you need to output the content of email onto the page.aspx.

    Hope it helps.

     

    Sincerely,
    Vince Xu
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
  • Re: Pop up from an email link

    05-22-2008, 1:52 PM
    • Loading...
    • BNDIT
    • Joined on 05-10-2008, 11:28 PM
    • Posts 94

    3. In above JavaScript code, the content is retrieved from another page with variable "url". So you need put the email content to this page in order to be retrieved by Div.

    For example, you can use goPopup("page.aspx") to call the function. Before that, you need to output the content of email onto the page.aspx.

     

    Please kindly elabore on the above with step by step breakdown details in very slow motion.

    Thanks.

  • Re: Pop up from an email link

    05-23-2008, 6:07 AM

    Hi,

    For example:

    Page.aspx is the page for retrieving the email content just like the normal codes.

    In the main page, you can use goPopup("page.aspx?parameter") to retrieve the content from page.aspx via Ajax. In every email link, you can define onclick='goPopup("page.aspx?parameter")' to popup a div. The parameter you can define to retrieve the specific email.

     

    Sincerely,
    Vince Xu
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
  • Re: Pop up from an email link

    05-23-2008, 7:43 PM
    • Loading...
    • BNDIT
    • Joined on 05-10-2008, 11:28 PM
    • Posts 94

    Your help is much appreciated. Please advise the code to place in the email with any pertinent instructions.

    Thanks.

  • Re: Pop up from an email link

    05-26-2008, 3:49 AM

    AS to retrieving email, you can use Email2DB, which is more appropriate for you:

    http://www.parkersoft.co.uk/forum/

    Sincerely,
    Vince Xu
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
Page 1 of 1 (10 items)
Microsoft Communities
Page view counter