473,587 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Declare int in codebehind and use it in ascx file

2 New Member
I'm writing web application using ASP.NET 1.1 with C#...

What I want to use is to declare one variable, in this case integer in codebehind and be able to retrieve it through <% ... %> tag in ascx page. How do you do this?

Aparently I can't find info on this anywhere on the net and I've been searching for two days now...

thanks in advance

PS. I know that I probably should have written all my code in codebehind but I decided not to and I really need this problem solved right now.
Jul 8 '07 #1
1 1250
kenobewan
4,871 Recognized Expert Specialist
Welcome to TSDN. Why don't you just assign the value in the codebehind too?
Jul 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
622
by: Colin | last post by:
Hi there, I really need your help on this. I'm trying to learn to using the VS.2003 to create a User Control. In my aspx code has no problem to use the property "grossWaye" that has "register" in the aspx code if I don't use "Codebehind" directive. If I try to move the <script></script> coding the Codebehind of the VS2003. I don't know how to get the property "grossWaye". I post both User Control and .aspx codes for your help. Thanks in...
2
2474
by: Francisco Carvalho | last post by:
I have created a user control that gets loaded by a page. The user control has a codebehind, but when I change the code on the codebehind, it never runs. If on the other hand a run the same code on the .ascx file it runs with no problems. The directive(see below) was added automatically by VS.NET so I can't seam to know what the problem is. Any thoughts? Francisco
1
3373
by: rodrigo | last post by:
This is what I am doing public class GridCustomPaging : System.Web.UI.Page { protected System.Web.UI.WebControls.DataGrid DgSearch;
5
3208
by: news.microsoft.com | last post by:
Getting really frustrated, I've been trying for 6 hours now! Got this very simple web app having a main .aspx page which has a user control (added with the Register directive) and the TemplateTop.ascx wich works 100% until I try adding codebehind, eg; <%@ Control Codebehind="TemplateTop.ascx.cs" Inherits="TemplateTop" %> And in the TemplateTop.ascx.cs file: using ...
0
2034
by: M K | last post by:
Okay, here is my message: The base class includes the field 'Preview1', but its type (ICUser.uCtrlPreview) is not compatible with the type of control (ASP.previewImg_ascx). What I am trying to do is use a user control I created in a page. This control is a composite of an image and a couple of labels. I wanted include properties through the code behind. So I have my ascx file with it's codebehind file. In my ascx file I have this tag:...
2
1966
by: N. Demos | last post by:
I have a user control with code behind of which two instances are created/declared in my aspx page. The aspx page has code behind also, as I need to access methods of the usercontrols on page submit. I've read several post here and articles on the web on this topic. What little I have learned from them is that you have to pre-compile the usercontrol in order to access it in the aspx code behind. I did this, compiling the usercontrol...
0
1526
by: N. Demos | last post by:
Hello, I have a custom usercontrol, of which I have two instances of in my aspx page. Both the usercontrol and page have codebehind. In the page codebehind, I want a member variable for each usercontrol. My problem is that I keep getting a compiler error on the usercontrol variables in my page codebehind (BC30002: Type 'CityGeoPosSelectClass' is not defined.) For whatever reason, my usercontrol class is not being declared in the page...
5
982
by: DC | last post by:
Hi, with ASP 1.1 we use "satellite" Projects to develop Usercontrols. We then copy only the .ascx and the .dll to the actual webproject. Trying to migrate such a project to 2.0 does not work since the compiler complaints about the missing Codebehind .cs file. Is it possible to use the .ascx without codefiles in 2.0?
2
4023
by: newjazzharmony | last post by:
I have included a namespace in the "using" statements at the top of the codebehind page for an ascx page (user control). How can I access the objects in this namespace from the ascx page itself? Thanks, Jonathan
0
7924
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7854
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.