Friday, 16 August 2013

What is MVC Architecture (Model - View - Controller) ?

Model:
It handles  maintaining data and database works part. Model proceses events sent by controller. After processing completed these events then it sends processed data to controller (thus, controller may reprocess it) or directly to view side.
It responds to the request from the view and it also responds to instructions from the controller to update itself

View:This is responsible for displaying all or a part of  data to  user interface to show to the user. Controller or model tells view what to show the user. and view handles requests from user and informs controller.

 They are script based templating systems like JSP, ASP, PHP and very easy to integrate with AJAX technology.
Controller:Software Code also Controller is like brain of the system. that controls the interactions between the Model and View Because it processes every request, prepares another parts of the system like model and view.
The controller receives the input, it validates the input and then performs the business operation that modifies the state of the data model.  





Web user control in asp.net-2

 Web user control in asp.net-2



Web user control in asp.net-1

 Web user control in asp.net-1  




how to create simple chart control in asp net

 how to create simple chart control in asp.net




chart control with databse in asp net-1 video


chart control with databse in asp net-1

 how to use chart control in asp.net with example tutorial



Thursday, 15 August 2013

what is hidden field control in asp.net

Hidden field is a control which is used to store small amounts of data on the client.
It store one value for the variable and it is a preferable way when a variable's value is changed frequently. Hidden field control is not rendered to the client (browser) and it is invisible on the browser.
A hidden field was stored in client side and we can change the runtime value change of hidden filed.

See the simple example how to use a hidden field.

to write in aspx file:
<asp:HiddenField ID="HiddenField1" runat="server"  />  
 
to write in .cs file
if (HiddenField1.Value != null)
   {
    int val= Convert.ToInt32(HiddenField1.Value) + 1;
    HiddenField1.Value = val.ToString();
    Label1.Text = val.ToString();
   }

what is session state in asp.net

Session : session is Server Side saving your data for the session you are using the site, in the memory and that is defined in web.config for session state section otherwise 20 mins by default.

Advantages:
  • It easy implement and we can store any kind of object.
  • It helps handle user state and data all over the application.
  • Stores client data separately.
  • Session is secure and transparent from the user.

Disadvantages:

  • Performance overhead in case of large volumes of data/user, because session data is stored in server memory.
Who to create session like :
 
 protected void btnok_Click(object sender, EventArgs e)
{
Session["FirstName"] = txtfName.Text;
Session["LastAge"] = txtLast.Text;
Response.Redirect("Default2.aspx");
}

 
The session state is used to maintain the session of each user throughout the
application. Session allows information to be stored in one page and access in
another page and support any type of object. they will show username in all
the pages for that they will store username in session and they will access
that session username in all the pages.  

How to fetch the record  from session like:

if(!IsPostBack)
{
     //if session is null then manual provide session value
      if (Session["FirstName"] == null && Session["LastName"] ==null)
      {
          Session["FirstName"] = "Bhavesh";
           Session["LastName"] = "  Thumar";
 
           lblMsg.Text = "Welcome " + Session["FirstName"] + Session["LastName"];
     }
else
{
      //to print session value
       lblString.Text = Session["FirstName"]+" " + Session["LastName"];
       lblfName.Text = Session["FirstName"].ToString();
       lbllName.Text = Session["LastName"].ToString();
   }
}

Monday, 5 August 2013

SEO - what is seo and how does it work

when you enter a query in a search engine and type 'enter' you get a list of website results that contain that query term. Users normally tend to visit websites that are at the top of this list as they perceive those to be more relevant to the query.  websites rank better than the others then you must know that it is because of a powerful web marketing technique called Search Engine Optimization (SEO).

SEO is a technique which helps search engines find and rank your site higher than the millions of other sites in SEO is all about optimizing a web site for Search Engines. SEO thus helps you get traffic from search engines.

How to Work Search Engine  ?


  • Crawling - is the process of fetching all the website pages and linking to all the web site. This task is proceed by a software, called a crawler or a spider (or Google-bot).
  • Indexing - is the process of creating index for all the fetched web pages and keep that into a there database from where it can later be retrieved. Essentially, the process of indexing is identifying the  no\umber of words on that best describe the page and assigning the page to particular keywords.
  • Processing - When a search request coming to search engine, the search engine processes it . i.e. it compares the search string in the search request with the indexed pages in the database.
  • Retrieving Results - The last step in search engines' activities is retrieving the best matched results. Basically, it is nothing more than simply displaying them in the browser.
Search engines such as Google and Yahoo! often update their relevancy algorithm number of times per month and year. When you see changes in your rankings algorithmic something else outside of your control.
Although the basic principle of operation the minor differences between their relevancy algorithm lead to major changes in results relevancy.

CompareValidator in asp.net

CompareValidator most commonly used validator of  but it's still useful in some cases. It can compare two values, for instance the values of two controls. In the next example, I will show you a small example of how it can be used.

Small number:
<asp:TextBox runat="server" id="txtSmallNumber" />
Big number:
<asp:TextBox runat="server" id="txtBigNumber" />
<asp:CompareValidator runat="server" id="cmpNumbers" type="Integer"
controltovalidate="txtSmallNumber" controltocompare="txtBigNumber" operator="LessThan"
errormessage="The first number should be smaller than the second number!" />
 
Now, im am run the website, and test the two new fields. Here is what happens if you don't fill out the form correctly:
 






However, as you may have noticed, the content of the two textboxes is not checked before comparing it. For instance, it would be possible to enter nothing, or enter a piece of text instead of a number. You should always consider this when using the CompareValidator. RegularExpressionValidator, which we will show you how to use a bit later. 

how to use RequiredFieldValidator control example in asp.net

RequiredFieldValidator is actually simple example, You can use it to make sure that the user has entered something in a TextBox control. Let's give it a try, and add a RequiredFieldValidator in  asp.net  to our page. We will also add a TextBox to validate, as well as a button to submit the form with.


<form id="form1" runat="server">
    Your name:<br />
    <asp:TextBox runat="server" id="txtName" />
    <asp:RequiredFieldValidator runat="server" id="reqName" controltovalidate="txtName" errormessage="Please enter your name!" />
    <br />
    <asp:Button runat="server" id="btnSubmitForm" text="Ok" /> 
 </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
Actually, that's all we need to test the most basic part of the RequiredFieldValidator. 
I'm sure that all the attributes of the controls makes sense by now, so I won't go into details about them. 
Try running the website and click the button. You should see something like this: 
 
 








 





Right now, the button does nothing, besides posting back if the page is valid. We will change this by adding an onclick event to it:


<asp:Button runat="server" id="btnSubmitForm" text="Ok" onclick="btnSubmitForm_Click" />
  
In the CodeBehind file, we add the following event handler: 
 
protected void btnSubmitForm_Click(object sender, EventArgs e)
{
    if(Page.IsValid)
    {
        btnSubmitForm.Text = "Form is valid!";
    }
} 

Thursday, 1 August 2013

Web user control in asp.net

this article is how to create web user control in asp.net make easy way this is group of control in we can say that user name control simple step u can see than my name control..





 Now 2 step is add Web use control  :


now 3 step is code in web control Cs file :








Now visit my Video in Youtube :
Part 1 : https://www.youtube.com/watch?v=WF-xUQYOJ5Y
Part 2 : https://www.youtube.com/watch?v=7__NJ6e063Y