enable or disable a form element using the.prop()method:// Disable #div1$( "#div1" ).prop( "disabled", true );// Enable #div1$( "#div").prop( "disabled", false );
29 Aug 2013
How do I disable/enable a form element?
How to Change colour on mouseover.
Hello.
The code to change colour (textbox,button,cell,tr etc). You can make a class in HTML design form and then call that function on code file.
Step 1:-
First of all make a css class as shown below:
The code to change colour (textbox,button,cell,tr etc). You can make a class in HTML design form and then call that function on code file.
Step 1:-
First of all make a css class as shown below:
<style type="text/css">
.normalRow
{
background-color:Red;
cursor:pointer;
.highlightRow
{
background-color:white;
cursor:pointer;
}
</style>
Step 2:-
Now call this css in code file like (this is for table row TR):
tr1.Attributes.Add("onmouseover", "this.className=('highlightRow');");
tr1.Attributes.Add("onmouseout", "this.className=('normalRow');");
Write a 'C' program to animate a circle?
The program in ‘C’ Programming language to draw a circle on
the screen and animate it is as follows:
#include <stdio.h>
#include <conio.h>
#include <graphics.h>
#include <dos.h>
#define RADIUS 50
#define DELAY 20
void main()
{
int x=0,
y=0, gdriver=DETECT, gmode=4;
clrscr();
initgraph(&gdriver,
&gmode, "C:\\TC\\BGI");
while(!kbhit())
{
for(x=0,
y=0; x<getmaxy() && !kbhit();)
{
circle(x++,
y++, RADIUS);
delay(DELAY);
cleardevice();
}
cleardevice();
}
getch();
closegraph();
27 Aug 2013
What is ASP.NET MVC
ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting.
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
Web Pages, MVC (Model View Controller), and Web Forms.
The MVC Programming Model
MVC is one of three ASP.NET programming models.
MVC is a framework for building web applications using a MVC (Model View Controller) design:
- The Model represents the application core (for instance a list of database records).
- The View displays the data (the database records).
- The Controller handles the input (to the database records).
The MVC model also provides full control over HTML, CSS, and JavaScript.
The MVC model defines web
applications with 3 logic layers:
applications with 3 logic layers:
The business layer (Model logic)
The display layer (View logic)
The input control (Controller logic)
The Model is the part of the application that handles the logic for the application data.
Often model objects retrieve data (and store data) from a database.
Often model objects retrieve data (and store data) from a database.
The View is the parts of the application that handles the display of the data.
Most often the views are created from the model data.
Most often the views are created from the model data.
The Controller is the part of the application that handles user interaction.
Typically controllers read data from a view, control user input, and send input data to the model.
Typically controllers read data from a view, control user input, and send input data to the model.
The MVC separation helps you manage complex applications, because you can focus on one aspect a time. For example, you can focus on the view without depending on the business logic. It also makes it easier to test an application.
What is C#?
C# is a modern, general-purpose object oriented programming language developed by Microsoft and approved by Ecma and ISO.
C# was developed by Anders Hejlsberg and his team during the development of .Net Framework.
C# is designed for Common Language Infrastructure (CLI), which consists of the executable code and runtime environment that allows use of various high-level languages to be used on different computer platforms and architectures.
The following reasons make C# a widely used professional language:
- Modern, general purpose programming language
- Object oriented.
- Component oriented.
- Easy to learn.
- Structured language.
- It produces efficient programs.
- It can be compiled on a variety of computer platforms.
- Part of .Net Framework.
Strong Programming Features of C#
Although C# constructs closely follows traditional high level languages C and C++ and being an object oriented programming language, it has strong resemblance with Java, it has numerous strong programming features that make it endearing to multitude of programmers worldwide.
Following is the list of few important features:
- Boolean Conditions
- Automatic Garbage Collection
- Standard Library
- Assembly Versioning
- Properties and Events
- Delegates and Events Management
- Easy to use Generics
- Indexers
- Conditional Compilation
- Simple Multithreading
- LINQ and Lambda Expressions
- Integration with Windows
How to getting Data through web Services with jquery in asp.net c#.
In Html
<div id="div_id"></div>
In Jquery code JqueryDatabind.js
$.fn.DataBind = function () {
var data = "{}";
var url = "Testing.aspx/get_data";
$(this).AjaxPOST(url, data, function (d) {
if (typeof (d[0]) !== 'undefined') {
$('#div_id').append(d[0].id.toString());
}
});
}
In Web Services Code
public class DataId
{
public string id;
}
[WebMethod]
public List<DataId> get_data()
{
List<DataId> dataid= new List<DataId>();
string query = "";
try
{
// pass your Sql connectionstring Web.config
SqlConnection con = new SqlConnection(Pass Your ConnectionString );
con.Open();
query = "select dataid From YourTableName";
SqlDataAdapter da = new SqlDataAdapter(query, con);
DataSet ds = new DataSet();
da.Fill(ds);
if(ds.Tables[0].Rows.Count>0)
{
DataListId data_list = new DataListId();
data_list.id= ds.Tables[0].Rows[0]["dataid"].ToString();
dataid.Add(data_list);
}
con.Close();
}
catch (Exception ex)
{
}
return dataid;
}
How to export GridView data to excel in asp.net in C#.
protected void btnexport_Click(object sender, EventArgs e)
{
string attachment = "attachment; filename=RepurchaseRpt".xls";
Response.Clear();
Response.AddHeader("content-disposition", attachment);
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
GridView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
}
{
string attachment = "attachment; filename=RepurchaseRpt".xls";
Response.Clear();
Response.AddHeader("content-disposition", attachment);
Response.Charset = "";
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
GridView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
}
Subscribe to:
Posts (Atom)
How to Create WEBSITE DESIGN
Way2finder Technologies is a web design studio that offers corporate web design and custom web design. Our website designers offer cheap w...
-
protected void btnexport_Click(object sender, EventArgs e) { string attachment = "attachment; filename=RepurchaseR...
-
var name = 'india' ; alert ( name ); var name = $ ( "#txtname" ). val (); alert ( name );
-
Way2finder Technologies is a web design studio that offers corporate web design and custom web design. Our website designers offer cheap w...