Asynchronous file upload using ajax and jquery in asp.net c#

Asynchronous file upload using ajax and jquery in asp.net c#

I am going to expain in this article how create custom properties in webuser controls, where you need to pass a value from your .aspx page to the user control (.ascx). This is possible in several ways but the easiest way is to create a properties of the user control and set it into the .aspx page and access it from the user control

Below  source code  is for how to pass boolean  value to user control-put this on page like below-.

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

using System;

using System.Collections.Generic;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

 

public partial class CustomPropertiese : System.Web.UI.UserControl

{

private Boolean vp_visible = false;

 

# region Properties

 

public Boolean IsVisible

{

get { return vp_visible; }

set { vp_visible = value; }

}

 

#endregion Properties

 

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

this.Visible = IsVisible;

}

}

}

another example-Here i am passing integer values to the User Control-

Pass attribute to the usercontrols like below-

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.IO;

 

public partial class controls_PremiumVenues : System.Web.UI.UserControl

{

Class obj = new Class();

private int vp_count = 0;

 

# region Properties

 

public int NoOfVenues

{

get { return vp_count; }

set { vp_count = value; }

}

 

#endregion Properties

 

protected void Page_Load(object sender, EventArgs e)

{

BindHotVenues(NoOfVenues);

}

}

About the author

admin administrator

Leave a Reply