Querystring in ASP.NET and C#.NET with Advanced mode

This blog always will helps you to learn topics from basics to advanced. Now i would like explain about QUERYSTRING in .Net by using Asp.net and C#.net
-------------------------------------------------------------------------------------------------------

Create one website with more than one web page Home.aspx and Contact.aspx

like

Come to the Home.aspx.cs side and write the code like this
Come to the Contact.aspx.cs side and write the code like this
Small comparison kindly view the picture at once as carefully

You must give key names as same. Otherwise you will get Exception like "object refrence not found"

Now we will discuss about theortical part about Querystring

Querystring: A Querysting is a technique uses to pass values from one page to anotherpage via URL

Important points about Querystring
------------------------------------
How to encrypt the Querystring data
How to pass special characters through querystring.

How to encrypt and decrypt the data in the Querysting and why we are go for this encryption and decryption
------------------------------------------------------------------------------------------------------------

Watch carefully in the image
Then How to Encrypt and Decrypt this for watch following image
Now you can check your Address bar URL

How to pass special Characters in QueryString

Here i passed the test with +-
check result
See the picture as carefuuly '+' symbol missing in the result. But it was shown in the addressbar

How to Reget means-> Simple you can unblock the Encrypt code.

Now you can able to get data with +. So encryption and decryption will helps a lot in the querystring.

Another way to get special character from the Querystring is

  Response.Redirect("http://localhost:4186/Contact.aspx?u=" + Server.UrlEncode(name_p), false);

by used "Server.UrlEncode" you can get full value from Querystring

--------------------------------------------------------------------------------------------------------

More Extra point regarding Query sting limit

Microsoft Internet Explorer has a maximum uniform resource locator (URL) length of 2,083 characters. Internet Explorer also has a maximum path length of 2,048 characters. 


                                                                                                              Happy coding with P.M@ruthi



Dataset Part2: Keep Your own query at Dataset Template

This Article will explain small extension of Dataset Template to write our own query at Adapter Design method

Select the Table and RightClick of the top of table and choose ADD->Query

Choose "Use SQL Statements"

Select Any one among of them and next ->
By Default it will display Basic Insert SQL Query. You can Erase this Query and Write your Query . You can Write your own Query by using 'QueryBuilder'
Give Your query Name here

Finally Finish it with next button with summary

Save and build once to load Dataset 
Check the code at once with your given queryname..By specification and Write down code as below..

Test at once in your sqlserver and you will able to see the values in your datatable.

------------------------------------------------------------Happy Coding with----m@ruthi

About Dataset and uses of Dataset in the .Net

This topic will covers basics and In-depth of Dataset

Dataset : Dataset is nothing but a collection of datatables and it is used to managing the operations of a datatables.

you can use dataset by two ways , One is by using Dataset template and Second way is Systsem.Data Namespace

Firstway :


select solution explorer and add new item -> choose Dataset under Data


After Click the ServerExplorer and choose ConnectToDatabase icon

I thought you people might have great idea how to give connections in the Adddatabase dialog box

Next you can able to find Database and their datatables what you given at Add database template



Drag Any table into Dataset Area


After it , Save and Build once your project, Because of Dataset load your table.

come to the code at .aspx.cs side , perform your code for insert query to the selected table without mension any connection and command on the coding page


Now you can find Insert built in insert command for this selected table "City_population is the table name" and it display list of datacolumns in the method intelligence part

For code 

Check your database and datatable..Data will be added into your datatable.

Next Article will explain how add your own Query to the Dataset and later sections will give explicit ways of dataset usage, Which means how to add dataset by programtically and how perform these actions by using native c#.net.....................................................................................
                                                                                                                 Happy-Coding with m@ruthi.

onclick vs onclientclick in Asp.net

What is the difference between ONCLICK and ONCLIENTCLICK in Asp.net

Watch This Tutorial at youtube by using following Url :
http://www.youtube.com/watch?v=9tgRRNR933s 

About OnClick :

<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Check Events" />

A Event will be create at server side as below

protected void Button1_Click(object sender, EventArgs e)
    {
         //write code here
          Response.Write("response coming from server");

    }

--------------------------------------
Execute the page

" click the button ofter you will  able to see the result ofter page refresh "

because asp:Button is server side control. 

But Now the same button will act like as  Native HTML button control.

How ?

About OnClientClick : 

Follow the following code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function m() {
            alert("hi");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
 
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Check Events" OnClientClick="m();" />
 
    </div>
    </form>
</body>
</html>

Now the button give alert box with "hi".

Note : Both Events will execute with clientclick as first and onclick as server


Webservices

Basic Things Regarding web service
----------------------------------------------------------------------------
* What is Web service
* Why it is 
* What we can do with this

Developer Environment
-----------------------------------------------------------------------------
* How to create Web service
* Consuming Web service
* Types of Web services ( Rest-ful and Simple)

Web Service :- 

Is a kind of service which is act as globally.

Why it is :-

To Implement the Remote type service to your app

What we can do with this :-

"Language Independent" and Service oriented feature to your app 

Simple Conceptual View


the figure represented minimal information regarding web service. but you will get several doubt's ofter seeing this picture . what is discomap file and how soap and uddi works in webservice . and how it will create service architectutre and remoting .

i will clear your doubts with an examples and i hope you will understand how to create , how to use and how to develop  because which is very easy

sample Example :

Initial steps to configure web service template to your .net application .

select the solution explorer -> add new item ->down the scroll choose webservice.asmx



create a basic web service with parameters  and with without parameters

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

/// <summary>
/// Summary description for sample
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class sample : System.Web.Services.WebService {

    public sample () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

// with out parameter

    [WebMethod]
    public string HelloWorld() {
        return "Hello World";
    }  

// with  parameters

    [WebMethod]
    public int add(int a, int b)
    {
        return a + b;
    }
    
}

Right click of the "sample.asmx" view in browser

with out parametre


with parametre



with parameters means it will ask your inputs .

this is the basic version of web service next step consume and developing web service with dbconnections it is very useful for the developers, means how it helpful at real time environment.

"as per my working senareios i will explain  how i used this webservice in where at project development"

                                                                                                                "Happy coding with P.m@ruthi"






Switch jqerytab under button click


These is very basic example to create a tab controller using jquery and accomplished one simple technique 'which is switching tab by using button" - it will help for u r real time environment
source code at aspx side [or] HTML page
---------------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Tabs - Default functionality</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <script>
        $(function () {
            $("#tabs").tabs();
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $(nxt).click(function () {
                $("#tabs").tabs("select", "#tabs-2");
            });
        });
    </script>
</head>
<body>

<div id="tabs">
    <ul>
        <li><a href="#tabs-1">pallamalli</a></li>
        <li><a href="#tabs-2">maruthi</a></li>
        <li><a href="#tabs-3">Processweaver software solutions </a></li>
    </ul>
    <div id="tabs-1">
        <p>First tab</p>
    </div>
    <div id="tabs-2">
        <p>Second tab.</p>
    </div>
    <div id="tabs-3">
        <p>Third tab</p>
    </div>
</div>
 <input type="button" value="click-next" id="nxt" />

</body>

-------------------------------
Note :- Move the third tab means [or] what ever the tab u want to move means  $("#tabs").tabs("select", "#tabs-2");

Give your tab id at "#tabs-2" place

Output view :-


- Copyright © complete .net tutorials - Skyblue - Powered by Blogger - Designed by Johanes Djogan -