ram27
asked on
asp.net/vb.net reusable code
Hi
i want to put below code into app_code folder as myTask.vb file which cna be re-usable accross the project in .aspx pages.
Currently, i do below
in my .aspx page,
i create <asp:Literal runat="server" ID="litForm" />. in code behind based o i populate this in "litForm_Load" function and i make "litForm" visible/invisible based on some condition.
Protected Sub litForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles litForm.Load
Dim sbForm As New StringBuilder
sbForm.AppendLine("<form action=""some website"" method=""post"">")
sbForm.AppendLine("<input type=""hidden"" name=""myV1"" value=""mytest1"" />")
sbForm.AppendLine("<input type=""hidden"" name=""myv2"" value=""" & ConfigurationManager.AppSe ttings.Ite m("mytest2 ") & """ />")
sbForm.AppendLine("<input type=""image"" name=""submit"" border=""0"" src=""mywebsite/mybtng.gif "" alt=""this is my test onlne"" />")
sbForm.AppendLine("</form> ")
litForm.Text = sbForm.ToString
when the user cliks on the image (mybtng.gif), page will be redirectred to the action url mentioned in <form> attribute.
I want to make above code re-usable accoress the projects. just wherever they need just reuse it.
Please help me.
i want to put below code into app_code folder as myTask.vb file which cna be re-usable accross the project in .aspx pages.
Currently, i do below
in my .aspx page,
i create <asp:Literal runat="server" ID="litForm" />. in code behind based o i populate this in "litForm_Load" function and i make "litForm" visible/invisible based on some condition.
Protected Sub litForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles litForm.Load
Dim sbForm As New StringBuilder
sbForm.AppendLine("<form action=""some website"" method=""post"">")
sbForm.AppendLine("<input type=""hidden"" name=""myV1"" value=""mytest1"" />")
sbForm.AppendLine("<input type=""hidden"" name=""myv2"" value=""" & ConfigurationManager.AppSe
sbForm.AppendLine("<input type=""image"" name=""submit"" border=""0"" src=""mywebsite/mybtng.gif
sbForm.AppendLine("</form>
litForm.Text = sbForm.ToString
when the user cliks on the image (mybtng.gif), page will be redirectred to the action url mentioned in <form> attribute.
I want to make above code re-usable accoress the projects. just wherever they need just reuse it.
Please help me.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER