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 8803023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:13:54+00:00 2026-06-14T01:13:54+00:00

I am currently creating a page that a user will be able to input

  • 0

I am currently creating a page that a user will be able to input information and on submit it should save this information to a text file, however I seem to be unable to obtain the textbox as it appears to be undefined even when an ID is set on it, could someone please explain what I am doing wrong? As it seems to be working correctly with my btnSave method.

Backend C#:

    public partial class Green_FreeShipping : System.Web.UI.Page
{
    private static readonly string FILE_PATH = "~/TextFiles/Notes.txt";

    private void GetNote()
    {
        using (TextReader tr = new StreamReader(MapPath(FILE_PATH)))
        {
            txtNote.Text = tr.ReadToEnd();
        }
    }

    private void SaveNote()
    {
        using (TextWriter tw = new StreamWriter(MapPath(FILE_PATH)))
        {
            tw.Write(txtNote.Text);
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.GetNote();
        }
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {
        this.SaveNote();
        this.GetNote();
    }
}

ASP.NET code:

<%@ Page Language="C#" MasterPageFile="~/admin/masters/admin.master" autoeventwireup="true" inherits="TextBox_ReadWriteToTextFile" Title="Green & Free shipping amounts" codefile="~/admin/bespoke/Green-FreeShipping.aspx.cs"%>

<%@ Register TagPrefix="web" Assembly="website.Web" Namespace="website.Web" %>
<%@ Register TagPrefix="sales" Assembly="website.site.Web" Namespace="website.site.Web.Sales" %>
<%@ Register TagPrefix="ecom" Namespace="website.site.Web" Assembly="website.site.Web" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="TitlePlaceHolder" runat="Server">
    <title>Shopfront - Green and Free shipping amounts</title>
</asp:Content>

<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="Server">
    <div style="margin-bottom: 20px;">
    <asp:textbox id="txtNote" runat="server" rows="5" textmode="MultiLine" width="200px" />
    </div>
    <asp:button id="btnSave" runat="server" onclick="btnSave_Click" text="Save" />
</asp:content>
  • 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-06-14T01:13:56+00:00Added an answer on June 14, 2026 at 1:13 am

    Your asp should inherit ‘Green_FreeShipping’ so that the c# can have access to the controls contained in it.

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

Sidebar

Related Questions

I'm currently creating a page in PHP that will display a user and their
I'm currently creating a page in PHP that will display a user and their
I am currently looking at creating a script for my site that will count
I am creating a bookmarklet button that, when the user clicks on this button
I'm currently creating an iPhone app (Xcode 4.3.1, IOS 5) that could use Bluetooth
I'm currently creating a iOS 5 iPad app where there will be heavy network
I'm currently creating a neighbourhood graph by doing roughly this: for every voxel look
I am creating a SaaS that will allow users to interact with it via
I'm creating a website template where the owner of the site will be able
I'm writing a script that will send user details to a PHP script via

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.