?
Solved

asp.net/vb.net reusable code

Posted on 2009-07-10
3
Medium Priority
?
450 Views
Last Modified: 2013-11-08
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.AppSettings.Item("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.








0
Comment
Question by:ram27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Author Comment

by:ram27
ID: 24826449
in above , i mentioned it should be in .vb file but it is not mandatory anywhere it could be control or ,vb file or anything , goal is to re-use accress the pages(.aspx) withing a web poject.
0
 
LVL 19

Accepted Solution

by:
daveamour earned 2000 total points
ID: 24829525
You need to look at writing a custom web control.
http://msdn.microsoft.com/en-us/library/aa728786(VS.71).aspx
 
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question