I want to set value for html input text through code behind but can't seem to work :(
p.s. i'm new to c# and this is my first c# project. I appreciate any type of help or critic.
Thanks!
Error in banana.cs: "txt_URL" is not in context
apple.html:
<%@ Page Language="C#"
AutoEventWireup="true".
src="banana.cs"
inherits="BananaPage.banana"
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<input id="txt_URL" type="text" name="txt_URL" runat="server"/>
</body>
</html>
banana.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text;
using System.Data;
namespace BananaPage
{
public partial class banana : Page
{
//Declare controls used
protected System.Web.UI.HtmlControls.HtmlInputText txt_URL;
protected void Page_Load(object sender, EventArgs e)
{
txt_URL.Value = "test";
}
}
}