I want to access the functions defined in ADO.vb file in my Default.aspx.vb file. note that the ADO.vb file is in the root directory. I can access it if it is in the App_Code directory. It it is in the root directory how can i access that?
While working on my FTP server, I am trying to access a class within my App_Code, but it is not working.When writing, the class is accessible/usable in the code like shown in picture. I get no build errors.But when I run it in the browser, I get an error stating that it cannot find my class.I've looked around some other posts on the forum, like using namespace, but it didn't work.
i have to write this piece of code in almost 10 to 15 content pages. i am just wondering if i can class file as base class for my content pages and write this piece of code in that class.
[Code]....
can somebody guide me how to write the base class for this scenario?
I have an issue with trying to create a Pdf file from my webpage. Basically, everythig involving creating the Pdf (using iTextSharp) is done, and I'm doing this as a File Stream (i.e, I'm saving the Pdf on local machine). Now what I'm trying to do is create it as a Memory Stream (i.e, open the Pdf from the browser). I was able to do this earlier when I wa still at the 1st version of the application, and all of the code behind was incluced in my .aspx.cs file. But now, I've kept the code in the .aspx.cs at a minimum and put the cude in classes and I'm creating onjects of thoses classes from the .aspx.cs
The problem is that the code from creating the Memory Stream is in a class as follows:
[Code]....
As you can imagine, the compiler cannot recognise "Response" as it's in a seperate class instead of in .aspx.cs
So i have some existing functionality from an older ASP.Net app that is a static class.
Say there's a static method in that class that returns a dataset that I would like to bind to something like a gridview or whatever I can build using MVC3.
I am using VB.Net/ASP.Net 2008/3.5 to create a Web Application and I am trying to access the Profile Class.
I notice that unlike a "Website" that you cannot access the Profile class from a "Web Application" and I was wondering what is the best way of adding the Profile class to a Web application?
I have no problem accessing these variables form .ascx.cs or .aspx.cs file -- ie. files that are part of the Web content. However, I can't seem to access 'Application' from basic class objects (ie. standalone .cs files). I read somewhere to use a slight variations in .cs files, as follows, but it always comes throws an exception when in use:
I need to be able to access simple page controls like a textbox from my page class. So if I have a simple aspx page with a textbox on it, I'm trying to do something like this. i'm not using codebehind btw:
[Code]....
I thought maybe I could pass a reference to the page into the class, something like:
[Code]....
But that's not working either. How can I access page controls from my class?
I'm wondering how I can go about accessing page controls from a separate class I've made. I've tried a few things I found using google, but no luck :(
What I'm trying to do is keep a function that is used often, in a global class.
The function then accesses a page literal and calls ScriptManager.RegisterStartupScript. I was hoping this is possible, so then this function wouldn't have to be copied to all of the pages.
I have several .aspx pages that all have identical code behind pages.For ease of maintenance,I would like all the aspx pages to share a common code behind page. To do this I have created a MyCommonClass class,which contains the common code.In the code behind of the .aspx pages, I have:
Partial class MyPage Inherits MyCommonClass End Class
But now the controls declared in the .aspx pages are not accessible in MyCommonClass.fix this?
I'm changing the CSS of my menu items during runtime to reflect which page is currently being viewed. It works fine. But, I have a nested master page that needs to change the CSS of the master page's items. How I can access the master page's menu items?
I have one C# windows class library type project which has a web reference whose settings are automatically added in to settings.settings file( Webservice name, type, scope, value).
I also have one separate ASP.net project which has let us as suppose, one page with a button. When I click this button, it calls a method of referred DLL of previous project and control goes there.
When in that project, when control goes in to location where I use this web reference, it tries to get the URL of web reference from settings file and raises an exception - 'The current configuration system does not support user-scoped settings'.
So, What is the way for me to call a c# project having web service in a asp.net project ? This is really a source stopper for our development.
I have a Custom WebControl. Inside this control I add a button and I want it to access an EventHandler that is on the WebForm where the control is included. The handler handles with controls from the WebForm, so it has to be there. I could probably manage to take the button out of the control, but it would be better to keep it on the control, for organization sake.
public class LanguageSelection : WebControl { private List<Language> _Languages; private CSSImageButton btnOk = new CSSImageButton();
I need to make a webservice in .net (I know how this works) but then I need to get data out of a database. But my company wants to make it in a way that you can use the system with multiple databases.
So my option was make multiple abstract classes which contains the folowing code (depending on the database type, this would be a SQL database)
I have build a UserControl with separate code behind file.In that code behind file i have defined some public properties in the Partial class of user control that was automatically generated.Those properties will initialize some properties of controls that are used in the control.Now, in .aspx page i used this User Control and initialized the public properties through code behind of aspx page for dynamic contents.
I created a httpHandler that successfully implements IHttpHandler for handling file uploads. It works perfectly fine. You send the file with the form, the class receives it and will save it to hard disk. It reads chunks of file with ReadEntityBody function of HttpWorkerRequest class.
Here is the situation i'm faced with.If at any stage before trying to read the file with ReadEntityBody, I try to access Request object (even Request.InputStream.Length!) ReadEntityBody would return 0 means it won't read from file stream.
After further testing I found out the reason behind it. Accessing to Context.Current.Request object will trigger some sort of functionality that will cause asp.net to handle file uploads at that moment by it's own! I believe this is a bug.
for example exactly after this line of code, asp.net will upload the file completely, and so there will be no stream for ReadEntityBody to read from later.
int FileSize = context.Request.InputStream.Length;
I want to access one image file residing in C: of the client's machine. I know with the help of file upload control (or say input type=file), this would be easy. Due to nature of my application (Its a KIOSK application), user is not expected to select file. I am just wondering how should I implement reading file without using file upload control. I want to store this file in Images folder of server. I am beginner to WCF. Should I look towards WCF?
I have a regular method I want to call. I need to use properties of the GridViewRowEventArgs Class within this method.
i.e.
[Code]....
Of course the above code is not valid because I don't think you can put GridViewRowEventArgs within the method like that. I don't want to put it within a event handler because that even handler is doing other things. I want to be able to call this seperatley.