How to make User Control in ASP.net? ,Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher
How to make User Control in ASP.net?

a) Add User Controll

write code:-

<hr color=red/>

<center><H1><SPAN 

style=\"COLOR: #ff9999; TEXT-DECORATION: underline\">BigBanyanTree.com</SPAN></H1></center> 

<hr Color=Green/>


b) In .aspx page:-

<%@ Register TagPrefix=a TagName=\"MyUserCtl\" Src=\"~/WebUserControl.ascx\"%>


c) Now use this :-

<a:MyUserCtl ID=\"tata\" runat=server/>

More interview questions and answers

What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }

void main() { if(~0 == (unsigned int)-1) printf("You can answer this if you know how values are represented in memory"); }

int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

main() { char *p = "ayqm"; printf("%c",++*(p++)); }

main() { int i=5; printf("%d",++i++); }

main() { char *p = "ayqm"; char c; c = ++*p++; printf("%c",c); }

While copying the objects if we say X a=b, X a(b) What will it call, assignment operator or copy constructor? Justify

int aaa() {printf("Hi");} int bbb(){printf("hello");} iny ccc(){printf("bye");} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }

main() { int i=5; printf("%d",i=++i ==6); }

What are the disadvantages of C++?

main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

void ( * abc( int, void ( *def) () ) ) ();

Explain why encapsulation is required?

main() { while (strcmp("some","some\0")) printf("Strings are not equal\n"); }

main() { char str1[] = {"s","o","m","e"}; char str2[] = {"s","o","m","e","\0"}; while (strcmp(str1,str2)) printf("Strings are not equal\n"); }

What are Polymorphic Classes?

main() { int i = 3; for (;i++=0;) printf("%d",i); }

What is public, protected, private?

void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf("%d",*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf("%d",*cptr); }

void main() { static int i; while(i<=10) (i>2)?i++:i--; printf("%d", i); }

main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

What is virtual class and friend class?

1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

What do you mean by pure virtual functions?

main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }

What is the diffrence between static_cast and dynamic_cast in RTTI

main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }

What is a fake pointer?

What is importance of const. pointer in copy constructor?

What is the difference between a pointer and a reference?

What is Smart Pointer?

How to Configure SMTP in asp .NET?

Print Hello World message using SharePoint in Asp.Net 2.0?

How to create a SharePoint web part using File upload control.give example?

What is BulletedList Control in Share Point. Give an example?

DescribeWizard server control with example in Share Point?

Define Life Cycle of Page in ASP.NET?

Write a program in ASP.NET to Show Data With Access?

Write a program to show connection with Oracle in ASP.NET?

Write a program to show connection to Excel in ASP.NET?

How to add Record in ASP.NET?

Write a program to Delete Record in ASP.NET ?

Write a program to show data in Gridview in ASP.NET?

Write a Program to Connect with dropdownlist in ASP.NET

How Repeater is used in ASP.NET?

How to show data in HTML table using Repeater?

Write a program to show the Use of dataList in ASP.NET?

How to make User Control in ASP.net?

main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }

main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

main() { char *p="GOOD"; char a[ ]="GOOD"; printf("\n sizeof(p) = %d, sizeof(*p) = %d, strlen(p) = %d", sizeof(p), sizeof(*p), strlen(p)); printf("\n sizeof(a) = %d, strlen(a) = %d", sizeof(a), strlen(a)); }

#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf("The dimension of the array is %d", DIM(arr, int)); }

int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf("The dimension of the array is %d", DIM(arr)); }

main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j),*(*(j+p)+i),*(*(i+p)+j), *(*(p+j)+i)); } }

main() { void swap(); int x=10,y=8; swap(&x,&y); printf("x=%d y=%d",x,y); } void swap(int *a, int *b) { *a ^= *b, *b ^= *a, *a ^= *b; }

main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }

#include main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr

Declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

main() { struct date; struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }

There were 10 records stored in "somefile.dat" but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen("somefile.dat","r"); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }

Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])

What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++

What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }

What is the hidden bug with the following statement?

What is the hidden bug with the following statement? assert(val++ != 0);

void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

#define assert(cond) if(!(cond)) \(fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\__FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }

Is the following code legal? struct a { int x; struct a b; }

Is the following code legal? struct a { int x; struct a *b; }

Is the following code legal? typedef struct a { int x; aType *b; }aType

Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }

void main() { printf("sizeof (void *) = %d \n", sizeof( void *)); printf("sizeof (int *) = %d \n", sizeof(int *)); printf("sizeof (double *) = %d \n", sizeof(double *)); printf("sizeof(struct unknown *) = %d \n", sizeof(struct unknown *)); }

char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)

Which version do you prefer of the following two, 1) printf("%s",str); // or the more curt one 2) printf(str)

What is Operator overloading?

What is the difference between run time binding and compile time binding?

What is Difference Between C/C++?

What is Difference Between C/C++

What will be the output of the following code? void main (){ int i = 0 , a[3] ; a[i] = i++; printf ("%d",a[i]) ; }

Why doesn't the following code give the desired result?

Why doesn't the following statement work? char str[ ] = "Hello" ; strcat ( str, '!' )

How do I know how many elements an array can hold?

How do I write code that reads data at memory location specified by segment and offset?

Is it possible to have Virtual Constructor? If yes, how? If not, Why not possible ?

What about Virtual Destructor?

What is problem with Runtime type identification?

How Virtual functions call up is maintained?

Can inline functions have a recursion?

How do you link a C++ program to C functions?

Explain the scope resolution operator?

How many ways are there to initialize an int with a constant?

What is the difference between a copy constructor and an overloaded assignment operator?

When should you use multiple inheritance?

What is a virtual destructor?

R4R provides free online tutolrails ,examples for Freshers and experts .We cover core java, tutorials, spring, Hibernate, python, struts, struts 2,c language, spring boot,PHP,MYSQL,C#,ASP.NET,WPF,WCF,Photoshop , JSP, programming, example, Interview questions and answer