Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7158485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:04:28+00:00 2026-05-28T13:04:28+00:00

Having a strange problem regarding the postback of a form I’ve created. The answer

  • 0

Having a strange problem regarding the postback of a form I’ve created. The answer will probably be really simple, but I can’t seem to see it.

I have a form that a user can fill in if the page a video is on, isn’t working. It pre-populates fields based on the current video selected, and allows the user to fill in other fields, and send the email to me for support.

The problem
The fields are pre-populated correctly, but one of the fields ‘Page’, although pre-populated correctly, doesn’t pass the value to the button submit method.

the clientside code
(includes some mootools javascript, this works)

<asp:Panel ID="pnlVideoProblem" runat="server" Visible="false">
        <h2>Report a video/learning tool issue</h2>
        <div class="keyline"></div>
        <fieldset class="emailform">
            <ul>
                <li><label>Name <span class="error">*</span></label><asp:TextBox ID="txtVideoName" runat="server" MaxLength="60"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator33" runat="server" CssClass="error" ControlToValidate="txtVideoName" ErrorMessage="Required"></asp:RequiredFieldValidator></li>
                <li><label>Email <span class="error">*</span></label><asp:TextBox ID="txtVideoEmail" runat="server" MaxLength="100"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator35" runat="server" CssClass="error" ControlToValidate="txtVideoEmail" ErrorMessage="Required"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" ControlToValidate="txtVideoEmail" Text="Invalid email" ErrorMessage="Email address is not in the correct format" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></li>
                <li><label>OTHER FIELD</label><asp:TextBox ID="txtOtherField" runat="server" MaxLength="10"></asp:TextBox></li>
                <li><label>Video ID</label><asp:TextBox ID="txtVideoID" runat="server" ReadOnly="true"></asp:TextBox></li>
                <li><label>Browser/Version </label><asp:TextBox ID="txtVideoBrowser" runat="server" MaxLength="100"></asp:TextBox></li>
                <li><label>Flash Version </label><asp:TextBox ID="txtFlashVersion" runat="server"></asp:TextBox></li>
                <li><label>Page </label><asp:TextBox ID="txtVideoPage" runat="server"></asp:TextBox></li>
                <li><label>Visible error messages </label><asp:TextBox ID="txtVisError" runat="server" TextMode="MultiLine" Rows="6" MaxLength="4000"></asp:TextBox></li>

            </ul>
            <asp:Button ID="btnSubmitVideoIssue" runat="server" CssClass="subbutton" Text="Submit report" OnClick="btnSubmitVideoIssue_Click" />
        </fieldset>
        <script type="text/javascript">
            window.addEvent('domready', function () {
                document.id('<%= txtVideoBrowser.ClientID %>').set('value', Browser.Platform.name + ", " + Browser.name + " " + Browser.version);
                document.id('<%= txtFlashVersion.ClientID %>').set('value', Browser.Plugins.Flash.version + "." + Browser.Plugins.Flash.build);
            });
        </script>
    </asp:Panel>

the page-behind code for the button
(there is no reseting of the values on postback)

protected void btnSubmitVideoIssue_Click(object sender, EventArgs e)
{
    if (CheckEmptyCaptcha() == false)
    {
        //this field is hidden in css and empty. if it has been filled in, then an automated way of entering has been used.
        //ignore and send no email.
    }
    else
    {
        StringBuilder sbMessage = new StringBuilder();

        emailForm = new MailMessage();

        sbMessage.Append("Name : " + txtVideoName.Text.Trim() + "<br>");
        sbMessage.Append("Email : " + txtVideoEmail.Text.Trim() + "<br>");
        sbMessage.Append("Other Field : " + txtOtherField.Text.Trim() + "<br>");
        sbMessage.Append("Video ID : " + txtVideoID.Text.Trim() + "<br>");
        sbMessage.Append("Browser : " + txtVideoBrowser.Text.Trim() + "<br>");
        sbMessage.Append("Flash Version : " + txtFlashVersion.Text.Trim() + "<br>");
        sbMessage.Append("Visible error messages : " + txtVisError.Text.Trim() + "<br>");
        sbMessage.Append("Url referrer : " + txtVideoPage.Text.Trim()+"<br>");
        sbMessage.Append("Browser : " + Request.UserAgent + "<br>");

        if (txtVideoBrowser.Text.Contains("ie 6"))
        {
            sbMessage.Append("<strong>Browser note</strong> : The PC that made this request looks like it was using Internet Explorer 6, although videos work in IE6, the browser isn't stable software, and therefore Javascript errors may occur preventing the viewing of the page/video/learning tool how it was intended. Recommend that the user upgrades their browsers to the latest version of IE.<br>");
        }
        Double flashver = 0.0;
        if(Double.TryParse(txtFlashVersion.Text, out flashver))
        {
            if(flashver < 9.0)
            {
                sbMessage.Append("<strong>Flash version note</strong> : The PC that made this request is currently using flash version "+flashver+". Flash version 9 or greater is required to view videos. Recommend user upgrades their flash version by visiting http://get.adobe.com/flashplayer<br>");
            }
        }
        else
        {
            sbMessage.Append("<strong>Flash version note</strong> : It doesn't look like flash is installed on the PC that made this request. Flash is required to view videos . Recommend user installs flash by visiting http://get.adobe.com/flashplayer<br>");
        }

        emailForm.To.Add(new MailAddress("admin@test.com"));
        emailForm.From = new MailAddress(txtVideoEmail.Text.Trim(), txtVideoName.Text.Trim());
        emailForm.Subject = "[ERROR] - [VIDEO ISSUE] from " + txtVideoName.Text.Trim();
        emailForm.Body = sbMessage.ToString();

        emailForm.IsBodyHtml = true;
        bool sendSuccess = false;

        try
        {
            SmtpClient smtp = new SmtpClient();
            smtp.Send(emailForm);
            sendSuccess = true;
        }
        catch
        {
            pnlVideoProblem.Visible = false;
            pnlFailure.Visible = true;
            ltlFailure.Text = "There was a problem sending your feedback, please go back and try again.";
        }
        finally
        {
            if (sendSuccess)
            {
                pnlVideoProblem.Visible = false;
                pnlSuccess.Visible = true;
                ltlSuccess.Text = "Thank you, your feedback has been sent. Click close to return to the website.";
            }
            else
            {
                pnlVideoProblem.Visible = false;
                pnlFailure.Visible = true;
                ltlFailure.Text = "There was a problem sending your feedback, please go back and try again.";
            }
        }
    }
}

the form values

Name : User
Email : User@test.com
Other Field : aab123
Video Learning ID : 5546
Browser version : win, firefox 9
Flash version : 11.102
Page : https://www.awebsite.com/library/video/5546
Visible error messages : ewrwerwe

the resulting email

Name : User
Email : user@test.com
Other Field : aab123
Video ID : 5546
Browser : win, firefox 9
Flash Version : 11.102
Url referrer : 
Visible error messages : ewrwerwe

Video ID and Page/Url Referrer are populated on (!IsPostBack)

(!IsPostBack)

pnlVideoProblem.Visible = true;
if (!String.IsNullOrEmpty(Request.QueryString["vid"]))
{
    txtVideoID.Text = Request.QueryString["vid"];
}

if (!String.IsNullOrEmpty(Request.QueryString["other"]))
{
    txtOtherField.Text = Request.QueryString["other"];
    txtOtherField.ReadOnly = true;
}
txtVideoPage.Text = HttpUtility.UrlDecode(Request.QueryString["ref"]);
txtVideoPage.ReadOnly = true;

any ideas? I have a brick wall i can hit my head against based on how simple the answer is.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:04:28+00:00Added an answer on May 28, 2026 at 1:04 pm

    Solved 🙂

    After a tiny ray of sunshine i remembered I had this

    RewriteRule ^/pop/(.*[^/])/report-issue/([a-fA-F0-9]{32})-([0-9]+)$ /pop.aspx?tp=$1&pg=report-issue&vid=$2&other=$3&ref=%{HTTP_REFERER} [L]
    

    as a rewrite rule, which then led me to take a closer look at whether the form fieldswere actually was wrapped in a postback. Lo-and-behold, they werent.

    I’ve wrapped a !postback around the querystring variable reading section and it works!

    brick wall needs to be very thick.

    thanks to those that tried to help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback,
I'm having a strange problem that I can't work out and wonder if anybody
I'm having a strange problem here, and I can't manage to find a good
I am having a strange problem, maybe you can help: I'm trying to convert
I am having a strange problem and I can't seem to figure it out.
I'm having a strange problem. I want to put border around the image, but
I've got a strange problem regarding linq-to-sql, and i've really tried search around for
I'm having a strange problem in Visual Studio 2008 where my Pending Checkins window
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
i am having a strange problem, i have a static class like this public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.