Started New Blog Services Ahmedabad Live News
Started another New Blog Services MoonEyes Cars

Wednesday, June 5, 2013

Remove key from querystring asp.net

protected void Page_Load(object sender, EventArgs e)
{
    string currentUrl = "http://localhost:39211/?page=2&sort=1&link=12&category=papers";


    string result = RemoveQueryString(currentUrl, "link");
    Response.Write(result);
}


public string RemoveQueryString(string url, string key)
{
    string pattern = key + "=[^&]+&?";
    System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex(pattern);
    return regex.Replace(url, "");
}

Tuesday, May 22, 2012

defaulttest

   
   
      add name="constr" connectionString="Data Source=JAGDISH;Initial Catalog=jaincmsdb;Integrated Security=false;" providerName="System.Data.SqlClient" 
     add name="constr" connectionString="Initial Catalog=tourdb;Data Source=JAGDISH;Integrated Security=SSPI;"
  add name="constr" connectionString="Data Source=XP8\SQL2008;Initial Catalog=jaincmsdb;User ID=sa;Password=sasql;" providerName="System.Data.SqlClient" 
     add name="constr" connectionString="Data Source=174.122.105.131;Initial Catalog=jaincmsdb;User ID=pathik;Password=pathik123;" providerName="System.Data.SqlClient"  

   
 

testing

Imports Microsoft.VisualBasic
Imports System.Data
Imports System.Data.SqlClient
Imports DAL

Namespace DAL

    Public Class db

        '''

        ''' Function return connection string with open state
        '''

        '''
        '''
        Public Function OpenConnection() As SqlConnection

            SqlConnection.ClearAllPools()
            Dim str As String = ""
            str = ConfigurationManager.ConnectionStrings("con").ConnectionString
            Dim cn As New SqlConnection
            cn.ConnectionString = str
            cn.Open()
            Return cn


        End Function

        '''
        ''' Function use the execute non query
        '''

        '''
        '''
        '''
        Public Sub ExecuteNonQuery(ByVal strQuery As String, Optional ByVal strFunctionName As String = "")

            HttpContext.Current.Trace.Warn(strFunctionName & ":" & strQuery)
            Dim cn As New SqlConnection
            Dim cmd As New SqlCommand


            Try

                cn = OpenConnection()
                cmd.Connection = cn
                cmd.CommandType = CommandType.Text
                cmd.CommandText = strQuery
                cmd.ExecuteNonQuery()

            Finally

                cn.Close()

            End Try

        End Sub


        '''
        ''' Function return dataset
        '''

        '''
        '''
        '''
        Public Function FillDataset(ByVal strQuery As String, Optional ByVal strFunctionName As String = "") As DataSet

            HttpContext.Current.Trace.Warn(strFunctionName & ":" & strQuery)
            Dim cn As New SqlConnection
            Dim cmd As New SqlCommand
            Dim dst As New DataSet
            Dim da As New SqlDataAdapter

            Try

                cn = OpenConnection()
                cmd.Connection = cn
                cmd.CommandType = CommandType.Text
                cmd.CommandText = strQuery
                cmd.ExecuteNonQuery()
                da = New SqlDataAdapter(cmd)
                da.Fill(dst)

            Finally

                cn.Close()

            End Try

            Return dst

        End Function

        '''
        ''' Function return dataset
        '''

        '''
        '''
        '''
        Public Function FillDatareader(ByVal strQuery As String, Optional ByVal strFunctionName As String = "") As SqlDataReader

            HttpContext.Current.Trace.Warn(strFunctionName & ":" & strQuery)
            Dim cn As New SqlConnection
            Dim cmd As New SqlCommand
            Dim dr As SqlDataReader

            cn = OpenConnection()
            cmd.Connection = cn
            cmd.CommandType = CommandType.Text
            cmd.CommandText = strQuery
            dr = cmd.ExecuteReader()
            Return dr


        End Function


    End Class

End Namespace

Monday, July 18, 2011

the server didn't reply with a proper xml data. please check your configuration. fckeditor

the server didn't reply with a proper xml data. please check your configuration. fckeditor
For newbies do the following:

1. Download the FCKEditor Source
2. Extract the contents
3. Create a folder in your Web Project called FCKEditor
4. Drag the files you extracted from the download into the FCKEditor folder in Visual Studio (VS will automatically copy the files across to the new folder you created).
5. Download the FCKEditor.NET release
6. Extract the contents to a folder where you keep your web solution files (I created a folder called FCKEditor.Net)
7. In Visual Studio, right-click your solution and select "Add Existing Project"
8. Browse to the folder where you extracted FCKEditor.NET and select the correct project (Visual Studio 2003 or 2005)
9. You should see a new project in your solution called FredCK.FCKEditorV2.vs2003 (or 2005)
10. Build this project, it should compile correctly
11. Select your Web Project and then right-click and choose Add Reference..
12. Once the Add Reference dialog box appears select the Project tab and then select the FredCK.FCKEditorV2 project
13. Compile your solution

This adds a reference to the Web Project from your FredCK project, this is how you work with a large solutions with many sub projects that are related by referencing the projects you need.

The control will also appear in your Tool Box so you can drop in the FCKEditor control onto your ASPX page and start using it.

Enjoy,
Jagdish

Wednesday, February 9, 2011

Error in microsoft site


Today I searched something about date format at that time I found below link
http://msdn.microsoft.com/en-us/library/ms187928.aspx
I really get socked and I thing you too. Because microsoft site give error.
We can show this link to our client when we are in trouble we may told that If microsoft site has error then we are normal programmer.

Wednesday, January 12, 2011

Meta tag not works in asp.net

I found one bug in asp.net which is basically if you have protected variable and you want to use this variable in .aspx page then you may easily use

Example :
dim strTemp as Protected
In page load event wrote
strTemp="Hello"

Now in .aspx page you can print "Hello" by write <%=strTemp%>

But when you want to write same thing in meta tag then we wrote



Above code is not work properly for that you need to write below code

Dim head As HtmlHead = CType(Page.Header, HtmlHead)
Dim KeywordMeta As HtmlMeta = New HtmlMeta()
KeywordMeta.Attributes.Add("Name", "keywords")
KeywordMeta.Attributes.Add("Content", "String with keywords")
head.Controls.Add(KeywordMeta)

Tuesday, January 11, 2011

Microsoft web matrix event 2010


Day to day microsoft give new features in web development. Recently microsoft has introduced new web development tool says webmatrix. Microsoft new web development tool's beta version launched in market already.
Now microsoft want to share some secretes of this tool with developer and common industrial man.

Microsoft Webmatrix is one of the most web development tool it's created for creating,customizing, and publishing website faster. It's doesn't matter how's your asp.net professional skills level. When you start with any GPL or GNU application for website development from scratch with templates designed,gallery, web matrix will make easy it's all stufs for you.
When you complete your website it's give great deals with hosting too. So it's also easy.

Please join Microsoft for webmatrix event at CodeMash, Her you can get live video of webmatrix event.And increase your productivity.

Event Date And Time : January 13, 2011. 11:00pm IST (+5:30 GMT)
Location:http://www.microsoft.com/web/enter

Click Her For Know More On Microsoft Webmatrix

Wednesday, January 5, 2011

MVP Award Program Nomination Form - India


Hello friends there is some good news who are going to do something extra for microsoft technology.
If you are regularly communicate in microsoft forums and answer on microsoft beta versions give some quality comment then you may suggest your name as a nomination of MVP award 2010.
If you are recently joined then please do not fill because microsoft consider more that 12 month for this.

Please Click Here for registration

Wednesday, December 29, 2010

How can i send bulk email in asp.net

When we are planning to send bulk email it's really challenging that it's not going into spam or junk. I have created on example from where you send bulk email in asp.net

Here I used gmail smtp for sending bulk mail you may use your smtp if you wish. If you face any problem then please write comment I will update it.

protected void btn1_Click(object sender, EventArgs e)
{
ArrayList list_emails = new ArrayList();

SmtpClient client = new SmtpClient();
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.EnableSsl = true;
client.Host = "smtp.gmail.com";
client.Port = 587;

// setup Smtp authentication
System.Net.NetworkCredential credentials =
new System.Net.NetworkCredential("your_mail_account@gmail.com", "password");
client.UseDefaultCredentials = false;
client.Credentials = credentials;



string[] listmails = .Split(';');
foreach (string email_to in listmails)
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress("your_gmail_account@gmail.com");
msg.To.Add(new MailAddress(email_to));
msg.ReplyTo= (new MailAddress("bhadreshpanchal@cyberdesign.co.in"));
msg.Subject = "This is a test Email subject";
msg.IsBodyHtml = true;
msg.Body = string.Format("Test HTML Email123*****");

try
{
client.Send(msg);
Response.Write("Your message has been successfully sent.");
}
catch (Exception ex)
{
Response.Write("Your message has been successfully sent.");
Response.Write("Error occured while sending your message." + ex.Message);
}
}
}

Monday, December 27, 2010

fck not disable inside panel,fck error in asp.net

If you are use FCK editor into you system then there is some strange behavior of FCK editor. Which is when you use fck into asp.net panel and if you make panel enable="false" then all other asp control which are inside this panel is automatically become disable but FCK editor not become disable.

For this solution take any literal control with FCK load same content into it now at the time of disable panel make visible false this fck and visible true our literal control.

Thursday, December 16, 2010

Download Visual Basic for Windows Phone Developer Tools - RTW

Now Microsoft launch new developer tool for windows phone developer. Which is fully supported to silverlight.

Prerequisites:

- Windows Phone Developer Tools RTW
- Visual Studio 2010 Professional, Premium, or Ultimate

There are some issues :

1. XNA projects. XNA is not currently supported in Visual Basic. Developers using this release can create Visual Basic Silverlight applications for Windows Phone 7; however, there are no Visual Basic project templates available for XNA at this time.

2. Integration with Expression Blend for Windows Phone. Visual Basic Windows Phone applications are not currently supported in Expression Blend for Windows Phone.

Download from below Link.
Start Download !!

Microsoft going to launch silverlight 5.0

After Silverlight FireStarter event Microsoft going to the next release of Silverlight.
Silverlight 5 adds significant new features and capabilities, and enables developers to create premium media experiences and deliver rich applications across browsers, desktops and devices.
A Silverlight 5 beta will be available in the first half of next year, and the final release will ship in the second half of 2011.
Premium Media Experiences
Silverlight 5 will enable media experiences to go even further by adding:
• Hardware video decode: Silverlight 5 now supports GPU accelerated video decode, which significantly reduces CPU load for HD video. Using Silverlight 5, even low powered Netbooks will be able to play back 1080p HD content
• Trickplay: Silverlight 5 now enables variable speed playback of media content on the client with automatic audio pitch correction. This is great for training videos where you want to speed up the trainer while still understanding what he’s saying
• Improved power awareness will prevent screensavers from kicking in while you’re watching movies while allowing the computer to sleep when video is not playing.
• Remote-control support is now built-into Silverlight 5 - allowing users to control media playback with remote control devices.
Application Development
Silverlight provides a rich application development environment that enables you to build great web delivered applications.
Silverlight 5 delivers significant improvements for application development including:
• Databinding and MVVM: Silverlight 5 delivers significant data-binding improvements that improve developer productivity and provide better Silverlight/WPF feature convergence. Developers can now debug data-binding expressions, set breakpoints on bindings, and more easily determine errors. Implicit DataTemplates now allow templates to be created across an application to support a particular type by default. Ancestor RelativeSource bindings makes it easier for a DataTemplate to bind to a property on a container control. Binding in style setters allows bindings to be used within styles to reference other properties. And a new DataContextChanged event is being introduced to make handling changes easier. Markup extensions are also now support and allow code to be run at XAML parse time for both properties and event handlers, enabling cutting-edge MVVM support.
• WCF and RIA Services: Silverlight 5 now includes WS-Trust support. WCF RIA Services improvements include complex type support, better MVVM support, and improved customization of code generation. Silverlight 5’s networking stack also now supports low-latency network scenarios that enable more responsive application scenarios.
• Text and Printing: Silverlight 5 delivers improved text clarity that enables crisper and cleaner text rendering, multi-column text flow and linked text containers, character and leading support, and full OpenType font support. Silverlight 5 also includes a new Postscript Vector Printing API that provides programmatic control over what you print, and enables printing richer reports and documents. Pivot functionality – which enables developers to build amazing information visualization experiences – will also be provided built-into the Silverlight 5 SDK.
• Graphics: Silverlight 5 includes immediate mode graphics support that enables developers to take full advantage of the GPU (graphics processing unit) and enables accelerated 3-D graphics support. This new support facilitates much richer data visualization scenarios (make sure to watch the keynote to see some really eye-popping ones).
• Out of Browser: Silverlight 5 builds on the out-of-browser capabilities we introduced with Silverlight 5. Out of browser applications can now create and manage child windows. Trusted out of browser applications can now also use P/Invoke capabilities to call unmanaged libraries and Win32 APIs. Enhanced group policy support enables enterprises to both lock down and open up security sandbox capabilities of Silverlight 5 applications.
• Testing Tools: We are adding automated UI testing support for Silverlight applications with Visual Studio 2010. This makes it easy to test Silverlight applications, and automate the functionality of them.
• Performance: Silverlight 5 support faster application startup, and provides 64-bit browser support. Silverlight 5 also integrates with the new Hardware Acceleration capabilities of IE9, and enables hardware acceleration in windowsless mode.

Thursday, December 9, 2010

Silverlight Firestarter Video Download

On Thursday, December 2, 2010 I enjoyed very much of live streaming of silverlight and got lots of knowledge from it. There below is main topics which microsoft tecle.
I will upload all silverligh video very soon.

Keynote : The Future of Silverlight

Be first to hear the official news about what’s coming up next for Silverlight from Scott Guthrie, Microsoft Corporate Vice President.
Data Binding In Silverlight and Windows Phone

Jesse Liberty walks us through the fundamentals of data binding, including binding to traditional and non-traditional data sources, binding to elements, binding in both Visual Studio and Blend, binding in code, data conversion and much more.
Building Compelling Apps with WCF using REST and LINQ

In this session we will cover how to build a WCF-based backend web service to provide data to the Silverlight application. We will demonstrate the use of LINQ in the service to retrieve objects from our database, and cover some details of how those objects are serialized to Silverlight. We will cover the use of faults for debugging and for driving production logic, as well as authentication strategies for internet and intranet deployment. We will finish with a look at how to access third-party REST/HTTP-based services from Silverlight.

Building Feature Rich Business Apps Today with RIA Services

Silverlight provides many different options for accessing distributed data including Web Services, REST APIs, sockets and more. This talk will walk you through the benefits that WCF RIA Services offers and demonstrate how it can be used to simplify n-tier programming and provide a flexible and productive way to access, validate and modify data in Silverlight applications. Topics covered include creating a domain service, simplifying asynchronous programming with the domain context, leveraging object tracking features, sharing data validation code between the client and server and writing domain services that can be used with any backend data access technology.

MVVM: Why and How? Tips and Patterns using MVVM and Service Patterns

See how good patterns and practices apply to Silverlight applications on the desktop, in the browser or on the phone. Learn how to integrate MVVM, Service Providers, design time data (aka Blendability), into your Silverlight applications to promote code reuse and create a highly maintainable application.
Tips and Tricks for a Great Installation Experience

Tired of seeing the spinning blue balls from Silverlight as the application loads? Your users probably are as well. The simple fact is that it is very easy to customize your complete application installation experience down to the plugin level. During this session you’ll see understand how Silverlight works with install/upgrade scenarios and how you can completely customize the installation experience. Additionally you’ll see custom ‘splash screen’ demonstrations on what you can do to further brand your application. If you are building an out-of-browser application with Silverlight we’ll discuss and demonstrate some of the tips/tricks to provide a good acquisition experience there as well and some tricks on automatically installing applications.

Tune Your Application: Profiling and Performance Tips

There are some common pitfalls that can negatively impact your Silverlight application’s performance. In this session we’ll demonstrate how to use some of the tools that are available to profile and identify performance issues. We’ll cover the available techniques with the performance tools that can help you to analyze your Silverlight application memory usage, rendering and CPU usage to help improve performance and avoid those common pitfalls.

Performance Tips for Silverlight Windows Phone 7

This will be a comprehensive deep-dive into Windows Phone performance. We will begin with the threading model changes and optimizations made to Silverlight run-time to take advantage of the GPU on the phone; we will then cover the most common pitfalls, the troubleshooting techniques, and close with the workarounds to create snappy Windows phone applications.

Please refer official fire starter event video on
http://www.silverlight.net/news/events/firestarter/

Wednesday, July 21, 2010

Microsoft Certified Professional

Hello everybody,

Herewith I declare that I have completed Microsoft Exam with 80% marks. Now I am Microsoft Certified Professional In ASP.Net 2.0

you may access my Microsoft profile page from below url

https://www.mcpvirtualbusinesscard.com/VBCServer/jagdish/profile

Monday, January 5, 2009

Seo Material

Display Page Rank Image on your Website
SEO Material provides free service i.e. display image of google page rank of your website to your visitors. Your visitors view your website rank without google tool bar.
Web Development

SEO Material deals with web project of any complexity and duration. Whether you need a small, nice looking website, a complex e-commerce web application or corporate website - we would be pleased to develop it for you. It's our website development strategy to working together to understand your business, brand and customers.
Link Building

Building links is one of the most important factors in getting top placements on the major search engines. Link Building is a very critical factor of any effective Search Engine Optimisation campaign today. The ‘off-page’ factors, such as link popularity, PageRank and Anchor Text in incoming links etc., play a major role in the ranking of your website in the search engine results pages. SEO Material offer batter link building services.

To take our web development, web designing, website promotion, SEO websites development and link building service - just contact us with following email or fill out Contact Us form.

Sunday, December 14, 2008

Now your turn to take decision ???

Now your Turn that either you have to go with SEO or not??
Our team is ready 24/7 whenever you want any feedback to us than we are capable to give your all question's answer as soon as possible.

SEO in RAJKOT

We doing SEO on your KEYWORD...

Choose your keywords

We choose your keyword which give you more trafic.
The first thing you need to do when you begin chasing a good search engine ranking is decide which words you want to rank well for. This is called performing a keyword analysis. Keyword analysis involves a bit of research and a good knowledge of your business and the benefits you offer your customers.There are several websites specifically designed to make keyword analysis easier.

i.You’re in a niche market with relatively few customers searching for the keyword. In this situation, you’ll probably find it relatively easy to reach the top of the rankings,but you won’t generate a huge volume of traffic when you get there.

Do SEO in short time !!!!

Want to do seo in short time than meet my teem SEO secrate team at staying in RAJKOT But actually what we are doing that i am describe in some short?

Optimizing your web copy

The trick to optimizing your copy is using the most important keywords frequently and in the
right places without compromising the readability of your copy. But how do you define
“frequently”? And what are the right places? What if you want to target a few different
keywords? And for that matter, what should the wordcount of my pages be? Below are a few
tips which will help you out.

Saturday, November 22, 2008

Grand pa


My grand pa's temple at aambardi taluka jamjodhpur dist.jamnagar gujarat INDIA.

Tuesday, October 14, 2008

PERSONAL DOC

















1.) Standard Controls: The standard controls enable you to render standard form elements such as buttons, input fields, and labels.

Submitting Form Data Control: the Button, LinkButton, and ImageButton controls are use to submit a form to the server
A.) Button : push button that you can use to submit a form to the server
script runat="server"

Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
lblTime.Text = DateTime.Now.ToString("T")
End Sub
script

asp:Button
id="btnSubmit"
Text="Submit"
OnClick="btnSubmit_Click"
Runat="server"



asp:Label
id="lblTime"
Runat="server" />


Some properties
OnClientClick, click, Command Raised when the Button control is clicked. The CommandName and CommandArgument are passed to this event.

B.) ImageButton : However, the ImageButton control always displays an image.
Note: Always include alternate text for any image. The accessibility guidelines require it. Furthermore, remember that some people turn off images in their browsers for a faster surfing experience.
You can use the ImageButton control to create a simple image map.
Sub btnTarget_Click(ByVal sender As Object, ByVal e As ImageClickEventArgs)



Code
If (e.X > 90 And e.X < 110) And (e.Y > 90 And e.Y < 110) Then
lblResult.Text = "You hit the target!"
Else
lblResult.Text = "You missed!"
End If
Design
asp:ImageButton
id="btnTarget"
ImageUrl="Target.gif"
Runat="server" OnClick="btnTarget_Click"

Some Important properties of image button;
AlternateText, CommandArgument, CommandName, GenerateEmptyAlternateText
ImageAlign : Possible values are AbsBottom, AbsMiddle, Baseline, Bottom, Left, Middle, NotSet, Right, TextTop, and Top.
ImageUrl, OnClientClick, Focus, Click, Command

C.) LinkButton : Unlike a Button control, however, the LinkButton control renders a link instead of a push button.

Example:
Code
Sub lnkSubmit_Click(ByVal sender As Object, ByVal e As EventArgs)
lblResults.Text = "First Name: " & txtFirstName.Text
lblResults.Text &= "
Last Name: " & txtLastName.Text
End Sub
Design
asp:LinkButton
id="lnkSubmit"
Text="Submit"
OnClick="lnkSubmit_Click"
Runat="server"

hyperlink rendered by the LinkButton control looks like this:
a id="lnkSubmit" href="javascript:__doPostBack('lnkSubmit','')">Submit a

Supports the following properties : AccessKey, Enabled, OnClientClick, PostBackUrl, TabIndex, Text, Focus, click, Command


Displaying Images
A.) Image : The image is displayed by setting the ImageUrl property of the Image control contained in the body of the page.
Sub Page_Load()
Dim rnd As New Random()
Select Case rnd.Next(3)
Case 0
imgRandom.ImageUrl = "Picture1.gif"
imgRandom.AlternateText = "Picture 1"
Case 1
imgRandom.ImageUrl = "Picture2.gif"
imgRandom.AlternateText = "Picture 2"
Case 2
imgRandom.ImageUrl = "Picture3.gif"
imgRandom.AlternateText = "Picture 3"
End Select
End Sub

Image control supports the following properties
AlternateText, DescriptionUrl, GenerateEmptyAlternateText, ImageAlign, ImageUrl


k) Label : Whenever you need to modify the text displayed in a page dynamically, you can use the Label control
script runat="server"
Sub Page_Load()
lblTime.Text = DateTime.Now.ToString("T")
End Sub
script



form id="form1" runat="server"
div
asp:Label
id="lblTime"
Runat="server" /

/div
/form
/body Output

you can place the text between the Label control's opening and closing tags
By default, a Label control renders its contents in an HTML span tag.
The Label control supports several properties Some of them are describe here
• BackColor, BorderColor, BorderStyle, BorderWidth , CssClass,Font, ForeColor Style , ToolTip
Note: use Cascading Style Sheets to format the rendered output of the Label control.


Accepting User Input Control : The ASP.NET Framework includes several controls that you can use to gather user input. TextBox, CheckBox, and RadioButton controls. These controls correspond to the standard types of HTML input tags.
A.) TextBox : The TextBox control can be used to display three different types of input fields depending on the value of its TextMode property
a. SingleLine Displays a single-line input field.
b. MultiLine Displays a multi-line input field.
c. Password Displays a single-line input field in which the text is hidden.

asp:TextBox
id="txtUserName"
TextMode="SingleLine"
Runat="server" /

br / br /

asp:TextBox
id="txtPassword"
TextMode="Password"
Runat="server" /

br / br /

asp:TextBox
id="txtComments"
TextMode="MultiLine"
Runat="server" /

You can use the following properties to control the rendering characteristics of the TextBox contro
AccessKey: AutoCompleteType: The ASP.NET Framework does not support AutoComplete for other browsers such as FireFox or Opera.
AutoPostBack: You should avoid using the AutoPostBack property for accessibility reasons. Because it’s very confusing to someone
Columns: Enabled: MaxLength: ReadOnly: Rows: TabIndex: Wrap:
Focus: You can also set the form focus by setting either the Page.SetFocus() method or the server-side HtmlForm control's DefaultFocus property.
TextChanged
B.) CheckBox: enables you to display, well, a check box.

asp:CheckBox
id="chkNewsletter"
Text="Receive Newsletter?"
Runat="server" /
• CheckBox includes a Text property that is used to label the CheckBox
• If you use this property, then the proper (accessibility standardscompliant) HTML label tag is generated for the TextBox.
• Some Properties
o Checked, Enabled, Text, TextAlign, Focus, CheckedChanged
C.) CheckBoxList : The CheckBoxList control renders a list of check boxes.
• rendered horizontally or vertically
• can select multiple items when using a CheckBoxList control.

asp:CheckBoxList id="cblMovies"
DataSourceID="srcMovies"
DataTextField="Title"
DataValueField="Id"
RepeatColumns="2"
Runat="server" /
three properties that affect its layout
• RepeatColumns , RepeatDirection ,RepeatLayout

D.) RadioButton : use the RadioButton control in a group. Only one radio button in a group of RadioButton controls can be checked at a time.
Example:
How did you hear about our Website?

ul
li
asp:RadioButton
id="rdlMagazine"
Text="Magazine Article"
GroupName="Source"
Runat="server" /
/li
li
asp:RadioButton
id="rdlTelevision"
Text="Television Program"
GroupName="Source"
Runat="server" /
/li
li
asp:RadioButton
id="rdlOther"
Text="Other Source"
GroupName="Source"
Runat="server" /
/li
/ul

Some properties of radio button
Checked, GroupName, TabIndex, TextAlign, CheckedChanged
E.) RadioButtonList : like the DropDownList control, enables a user to select only one list item at a time, arranged either horizontally or vertically
Example: asp:RadioButtonList
id="rblMovies"
DataSourceID="srcMovies"
DataTextField="Title"
DataValueField="Id"
RepeatColumns="3"
Runat="server" /

asp:SqlDataSource
id="srcMovies"
SelectCommand="SELECT Id, Title FROM Movies"
ConnectionString=" %$ ConnectionStrings:Movies % "
Runat="server" /



Using the Panel Control
A.) Panel : The Panel control enables you to work with a group of ASP.NET controls. you can use a Panel control to hide or show a group of ASP.NET controls.
Design view’s code
asp:Panel
id="pnlOther"
Visible="false"
Runat="server"

asp:Label
id="lblOther"
Text="Other Language:"
AssociatedControlID="txtOther"
Runat="server" /
asp:TextBox
id="txtOther"
Runat="server" /

/asp:Panel
The Panel control supports the following properties:
DefaultButton, Direction, GroupingText, HorizontalAlign, ScrollBars

If you set the GroupingText property, however, the Panel control renders a fieldset tag. The value that you assign to the GroupingText property appears in the fieldset tag's legend tag.
Notes: Don't use the values Horizontal or Vertical with the ScrollBars property when you want the scrollbars to appear in browsers other than Microsoft Internet Explorer. If you want the scrollbars to appear in FireFox and Opera, use either the value Auto or Both.

Note: Every control in the ASP.NET framework supports the Visible property.
h) HyperLink : The HyperLink control enables you to create a link to a page. Unlike the LinkButton control, the HyperLink control does not submit a form to a server.
Example:
Code
Sub Page_Load()
lnkRandom.NavigateUrl = GetRandomFile()
End Sub
Design
asp:HyperLink
id="lnkRandom" Text="Random Link" Runat="server" /
HyperLink control supports the following properties
Enabled, ImageUrl, NavigateUrl, Target, Text
Note: Notice that you can specify an image for the HyperLink control by setting the ImageUrl property. If you set both the Text and ImageUrl properties, then the ImageUrl property takes precedence.

Using the Rich Controls
A.) FileUpload : control enables users to upload files to your web application.
Enabled, FileBytes, FileContent, FileName, HasFile, PostedFile, Focus, SaveAs
The HttpPostedFile class has the following properties (this is not a complete list): ContentLength, FileName, InputStream
Design asp:FileUpload
id="upImage"
Runat="server" /


B.) Calendar: The Calendar control enables you to display a calendar
You can use the calendar as a date picker or you can use the calendar to display a list of upcoming events.
Design: asp:Calendar
id="Calendar1"

Runat="server" /

Calendar control supports the following properties
DayNameFormat(FirstLetter, FirstTwoLetters, Full, Short, and Shortest), NextMonthText, NextPrevFormat(CustomText, FullMonth, and ShortMonth.), PrevMonthText, SelectedDate, SelectedDates, ShowTitle, TodaysDate, VisibleDate
The Calendar control also supports the following events:
• DayRenderRaised as each day is rendered.
• SelectionChangedRaised when a new day, week, or month is selected.
• VisibleMonthChangedRaised when the next or previous month link is clicked

e) DropDownList

g) HiddenField
m) ListBox
n) MultiView and View
p) PlaceHolder


2.) Data Controls
a) GridView
b) DataList
c) DetailsView
d) FormView
e) Repeater
f) SqlDataSource
g) SiteMapDataSource








3.) Validation Control
Technically, you can use the validation controls with any control that is decorated with the ValidationProperty attribute.
By default, the validation controls perform validation on both the client (the browser) and the server. The validation controls use client-side JavaScript.
You can use the validation controls with browsers that do not support JavaScript (or do not have JavaScript enabled). If a browser does not support JavaScript, the form must be posted back to the server before a validation error message is displayed.

a) RequiredFieldValidator : control enables you to require a user to enter a value into a form field before submitting the form.
set two important properties when using the RequiredFieldValdiator control:
• ControlToValidate The ID of the form field being validated.
• Text The error message displayed when validation fails.

Design code is
asp:TextBox
id="txtFirstName"
Runat="server" /
asp:RequiredFieldValidator
id="reqFirstName"
ControlToValidate="txtFirstName"
Text="(Required)"
Runat="server" /

Note: By default, the RequiredFieldValidator checks for a nonempty string (spaces don't count).


b) RangeValidator : control enables you to check whether the value of a form field falls between a certain minimum and maximum value.

Using the RangeValidator Control
The RangeValidator control enables you to check whether the value of a form field falls between a certain minimum and maximum value. You must set five properties when using this control:
• ControlToValidate The ID of the form field being validated.
• Text The error message displayed when validation fails.
• MinimumValue The minimum value of the validation range.
• MaximumValue The maximum value of the validation range.
• Type The type of comparison to perform. Possible values are String, Integer, Double, Date, and Currency.
Example: asp:TextBox
id="txtAge"
Runat="server" /
asp:RangeValidator
id="reqAge"
ControlToValidate="txtAge"
Text="(Invalid Age)"
MinimumValue="5"
MaximumValue="100"
Type="Integer"
Runat="server" /

with an age less than 5 or greater than 100, then the validation error message is displayed.
Note: Don't forget to set the Type property when using the RangeValidator control. By default, the Type property has the value String, and the RangeValidator performs a string comparison to determine whether a values falls between the minimum and maximum value.

D) CompareValidator: can use the CompareValidator to perform a data type check. In other words, you can use the control to determine whether a user has entered the proper type of value into a form field, such as a date in a birth date field.
The CompareValidator has six important properties: ControlToValidate, Text
• Type: The type of value being compared. Possible values are String, Integer, Double, Date, and Currency.
• Operator The type of comparison to perform. Possible values are DataTypeCheck, Equal, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual, and NotEqual.
• ValueToCompare The fixed value against which to compare.
• ControlToCompare The ID of a control against which to compare.
Design Code:
asp:CompareValidator
id="cmpBirthDate"
Text="(Invalid Date)"
ControlToValidate="txtBirthDate"
Type="Date"
Operator="DataTypeCheck"
Runat="server" /

C) RegularExpressionValidator : You can use a regular expression to represent string patterns such as email addresses, Social Security numbers, phone numbers, dates, currency amounts, and product codes.
Code: enables you to validate an email address
asp:RegularExpressionValidator
id="regEmail"
ControlToValidate="txtEmail"
Text="(Invalid email)"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
Runat="server" /

Note: There are huge collections of regular expression patterns living on the Internet. The easiest way to find a good regular expression for a pattern is to simply Google it.
E) CustomValidator : If none of the other validation controls perform the type of validation that you need, you can always use the CustomValidator control.
The CustomValidator control has three important properties:
• ControlToValidate The ID of the form field being validated.
• Text The error message displayed when validation fails.
• ClientValidationFunction The name of a client-side function used to perform client-side validation.
The CustomValidator also supports one event:
• ServerValidate This event is raised when the CustomValidator performs validation.
You associate your custom validation function with the CustomValidator control by handling the ServerValidate event.
Code:
Protected Sub valComments_ServerValidate(ByVal source As Object, ByVal args As System
.Web.UI.WebControls.ServerValidateEventArgs)
If args.Value.Length 10 Then
args.IsValid = False
Else
args.IsValid = True
End If
End Sub
Design
asp:CustomValidator
id="valComments"
ControlToValidate="txtComments"
Text="(Comments must be less than 10 characters)"
OnServerValidate="valComments_ServerValidate"
Runat="server" /

The second parameter passed to the ServerValidate event handler is an instance of the ServerValidateEventArgs class
• Value Represents the value of the form field being validated.
• IsValid Represents whether validation fails or succeeds.
• ValidateEmptyText Represents whether validation is performed when the form field being validated does not contain a value.

F) ValidationSummary : The ValidationSummary control enables you to display a list of all the validation errors in a page in one location.
If a user enters the wrong value for a form field located toward the end of the page, then the user might never see the error message. If you use the ValidationSummary control, however, you can always display a list of errors at the top of the form.
You might have noticed that each of the validation controls includes an ErrorMessage property. We have not been using the ErrorMessage property to represent the validation error message. Instead, we have used the Text property.
The distinction between the ErrorMessage and Text property ?? ErrorMessage property appears in the ValidationSummary control, and any message that you assign to the Text property appears in the body of the page
NOTE: If you don't assign a value to the Text property, then the value of the ErrorMessage property is displayed in both the ValidationSummary control and the body of the page.
Example: asp:ValidationSummary
id="ValidationSummary1"
Runat="server" /



4.) Login Controls
a) Login
b) LoginView
c) PasswordRecovery
d) LoginStatus
e) LoginName
f) ChangePassword

5.) Navigation Control
a) SiteMapPath
b) Menu
c) TreeView
6.) Data source Controls
d) Sql Datasource
e) Xml Datasource
f) Object Datasource
g) Sitemap Datasource








Themes
12. Applying Styles, Themes, and Skins
a) Applying Styles to Controls

b) The App_Themes Folder
You create a Theme by adding a new folder to a special folder in your application named App_Themes.
When using Visual Web Developer, you can create a new Theme folder by right-clicking the name of your project in the Solution Explorer window and selecting Add ASP.NET Folder, Theme.
A Theme folder can contain a variety of different types of files, including images and text files.
The most important types of files in a Theme folder are the following:
• Skin Files
• Cascading Style Sheet Files
Warning: Be careful about how you name your Theme (the folder name). The contents of a Theme folder are automatically compiled in the background into a new class. So you want to be careful not to name a Theme with a class name that conflicts with an existing class name in your project.

C) Global and Application Themes
You can share the same Theme among multiple web applications running on the same web server. A Global Theme can contain both Skin files and Cascading Style Sheet files.
You create a Global Theme by adding the Theme to the Themes folder located at the following path:
WINDOWS\Microsoft.NET\Framework\[version]\ASP.NETClientFiles\Themes
After you add a Theme folder to this path, you can immediately start using the Theme in any file systembased website.
If you want to use the Theme in an HTTP-based website, you need to perform an additional step. You must add the Theme folder to the following path:
Inetpub\wwwroot\aspnet_client\system_web\[version]\Themes
You can copy the Theme to this folder manually or you can use the aspnet_regiis tool to copy the Theme folder. Execute the aspnet_regiis tool from the command line like this:
aspnet_regiis -c

D) Assigning a Theme to a Page
A Theme can contain one or more Skin files. A Skin enables you to modify any of the properties of an ASP.NET control that have an effect on its appearance.
The Skin is applied to every page to which the Simple Theme is applied.
Add Code in Head %@ Page Language="C#" Theme="Simple" %
Note: By default, all control properties are themeable (can be modified in a Skin file). However, certain control properties are decorated with the Themeable(False) attribute, which disables theming.

e) Assigning a Theme in Config
Rather than add the Theme or StyleSheetTheme attribute to each and every page to which you want to apply a Theme, you can register a Theme for all pages in your application in the web configuration file.
Code in Web.Config
?xml version="1.0"?
configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
system.web

pages theme="Site" /

/system.web
/configuration
Rather than use the theme attribute, you can use the styleSheetTheme attribute to apply a Theme to the pages in an application.
?xml version="1.0"?
configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
system.web

pages styleSheetTheme="Site" /

/system.web
/configuration

After you enable a Theme for an application, you can disable the Theme for a particular page by using the EnableTheming attribute with the %@ Page % directive.
Code: %@ Page Language="VB" EnableTheming="false" %


f) Disabling Themes for a Control
Every ASP.NET control includes an EnableTheming property.
You can use the EnableTheming property to prevent a Skin from being applied to a particular control in a page.

g) Default and Named Skins
Default:
Create: Simple\TextBox.skin
Code:
asp:TextBox
BackColor="Yellow"
BorderStyle="Dotted"
Runat="Server" /

And add code before the head
%@ Page Language="VB" Theme="Simple" %

Now all textbox in that particular form become dotted and yellow
Named Skins : When you create a Named Skin, you can decide when you want to apply the Skin.For example, you might want required fields in a form to appear with a red border. In that case, you can create a Named Skin and apply the Skin to only particular TextBox controls.
Create: Simple2\TextBox.skin
asp:TextBox
SkinID="DashedTextBox"
BorderStyle="Dashed"
BorderWidth="5px"
Runat="Server" /

asp:TextBox
BorderStyle="Double"
BorderWidth="5px"
Runat="Server" /

Design Code:
asp:TextBox
id="txtFirstName"
SkinID="DashedTextBox"
Runat="server" /

br / br /

asp:TextBox
id="txtLastName"
Runat="server" /

the first TextBox appears with a dashed border and the second TextBox appears with a double border


h) Contents of a Theme and Skin

i) Using CSS in Themes
As an alternative to Skins, you can use a Cascading Style Sheet file to control the appearance of both the HTML elements and ASP.NET controls contained in a page.
If you add a Cascading Style Sheet file to a Theme folder, then the Cascading Style Sheet is automatically applied to every page to which the Theme is applied.
For example, App_Themes\StyleTheme\SimpleStyle.css
Write code in simplestyle.css is
html
{
background-color:gray;
font:14px Georgia,Serif;
}

Now just add %@ Page Language="VB" Theme="StyleTheme" %
The Cascading Style Sheet is used to style several HTML elements in
Style Sheet sets the background color of the page to the value Gray.
The advantage of using Cascading Style Sheets is that they result in leaner and faster loading pages. The more content that you can place in an external Style Sheet, the less content must be loaded each time you make a page request
When you add multiple Style Sheets to a Theme, the style sheets are linked to a page in alphabetical order
link href="App_Themes/Simple/ThemeA.css" type="text/css" rel="stylesheet" /
link href="App_Themes/Simple/ThemeB.css" type="text/css" rel="stylesheet" /
link href="App_Themes/Simple/ThemeC.css" type="text/css" rel="stylesheet" /

j) Using Images in Themes
k) Assigning the Theme in Code
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/themes/default.aspx