|
|
|
|
|
|
|
Author Rank :
|
|
|
Page Views :
|
2098
|
|
Downloads :
|
0
|
|
Rating :
|
Rate it
|
|
Level :
|
Beginner
|
|
Description
Hi Friends,
Life is a devastating now a days as suddenly I started working on ColdFusion. And truly speaking life is damn moving as Market goes. And now I think I am aiming for that disloyal title which is very respectable in our area. You name it I know it. Anyway finally lets back to business. In the previous article we are up with storing Page and here is the retrieving unit the user will input the name of the page that he is looking for and we will show the content of that page.
First menu Page doesn't load any of these two units (MobilePagecreate and MobilePageView). There is one more menu page in between the main menu and the units. This menu (in between the main menu and the units) contains the links for "create" and "view" pages.
So here check out the unit for Retrieving Page
Source Code:
// Source Code Starts <%@ Page Inherits="System.Web.UI.MobileControls.MobilePage" Language="C#" Debug="true" %> <%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.Data"%> <%@ Import Namespace="System.Data.SqlClient" %> <script runat="server" language="C#"> public string strAccessConn ="server=localhost;uid=sa;pwd=;database=practice"; public string str; public void Page_View(Object sender, EventArgs e) { if(Page.IsValid) { SqlConnection myConn = new SqlConnection(strAccessConn); SqlCommand myCommand = new SqlCommand("Select Page_Data from Page_Unit where Page_Name like '"+pagename.Text+"'",myConn); myConn.Open(); SqlDataReader myReader; myReader = myCommand.ExecuteReader(); while(myReader.Read()) { str= myReader["Page_Data"].ToString(); } if(str == "") { str= "Hi No such Page Exists"; } else { PageContent.Text= str ; } ActiveForm =Form2; } } </script> <mobile:Form id = "Form1" runat="server"> <mobile:Label runat="server" ID="Label1">Page Name</mobile:Label> <mobile:TextBox runat="server" id="pagename"/> <mobile:Command runat="server" OnClick="Page_View" Text="Go!" ID="Command1"/> </mobile:Form> <mobile:Form runat="server" id="Form2"> <mobile:Label id ="PageContent" runat="server"> </mobile:Label> <mobile:Link runat="server" NavigateURL="MobilePageEntry.aspx" ID="Link1"> Create New Page </mobile:Link> </mobile:Form> // Source Code End
This is Pretty simple and straightforward. So I hope it will be no Problem.
Rest in Next
bye
Shivani~~~~
|
|
Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post
Here.
|
|
|
|
|
Login
to add your contents and source code to this article
|
|
|
|
|
|
|
|
|
|
|
|
Shivani
Shivani is Electronics graduate from REC Bhopal, INDIA. After Electronics she jumped to software development and has been dealing with WAP and Java technologies. Currently she is working with C# and ASP.NET for a transaction Portal.
|
|
|
|
|
|
|
|
|
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional
consulting company, our consultants are well-known experts in .NET and many of them
are MVPs, authors, and trainers. We specialize in Microsoft .NET development and
utilize Agile Development and Extreme Programming practices to provide fast pace
quick turnaround results. Our software development model is a mix of Agile Development,
traditional SDLC, and Waterfall models.
|
|
Click here to learn more about C# Consulting. |
|
|
|
|
|
|
|
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon.
Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees.
As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
|
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
|
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
|
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
|
|
|
|
|
|
|
|
|
|
|
|
|