Is there a method to retrieve the file name of a class?
Specifically I would like to create a static method (CreateLink) in a base class (BasePage) to automatically return the path and filename of the page called.
I code in .C# ASP.NET
private const string TEMPLATE = "~/One.aspx";
public static HyperLink CreateLink()
{
HyperLink link = new HyperLink();
link.Text = "Click here";
link.NavigateUrl = String.Format(TEMPLATE);
return link;
}
Is it possible to avoid the use of TEMPLATE hardcoded variable? Is it possible to retrieve the One.aspx path from file name and location?
I am having .aspx page in which there exists one textBox , label and one button. When user enter some name in textbox and then click button. The event handler of button should call function in class file(.cs). The function in .cs should retrieve value of textBox control and set it for label there. And return back.
I have a C# class from which I would like to access a string contained within a TextBox. The TextBox is defined in a an .ascx file. What headers should I put in the class to be able to access this TextBox string?
I use asp.net 4 c# ef4.I need to retrieve a nested ListBox control in a DetailView control.Because I need call many times the ListBox from my source code I was thinking to create a reusable Class to get the ListBox from the paretn control DetailView.Here my code:
protected DetailsView GetCreateRelatedCategories { get
I want to retrieve private (implementation and other) methods of a class which implements an interface and also is derived from (inherits) a base class.
How can I achieve this using reflection? Is there anyother way to achieve this?
This is wat m tryin to do. I need to view these private methods and their contents, I don't want to invoke them.
Dim assembly As System.Reflection.Assembly Dim assemblyName As String assemblyName = System.IO.Path.GetFullPath("xyz.dll") assembly = System.Reflection.Assembly.LoadFile(assemblyName) assembly.GetType("myClass").Getmethods(Bindings.NonPublic) assembly.GetType("myClass").GetMethods(BindingFlags.NonPublic) isn't working
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.
my solution currently has a website project and a class library project. I am attempting to access a session object from my class library but it is always returning null. In a settings class in my class library I store these values like so:
private static SessionProperty<WebUser> _currentUser = new SessionProperty<WebUser>("CurrentUser", delegate { return new WebUser(); }); public static WebUser CurrentUser { get { return _currentUser.Value; } set { _currentUser.Value = value; } }
I can access this just fine from any aspx page codebehind like so:
How can I retrieve file information (size of file) before it is uploaded to the webserver?
I would like to create a multi file upload. I have it working in JQuery but I would like to know the size of the files to set a limition by summing up the total the file sizes together.
I have form for update product in which I have file upload control, in update product form i have retrieved all other details of product in appropriate text boxes like product name,price,etc. I also want to retrieve name and path of product image in file upload control which is uploaded using add product form. Is it possible to set path of uploaded file to file upload control.
i have created basic .aspx files .one is login.aspx and registration.aspx...Now in my solution explorer i also added class file i.e StudentInfo.cs and wrote some properties in it...now my question is
1. i want to connect Studentinfo.cs class to my login.aspx.cs...So that i can call the methods in Studentinfo.cs..how to do it?
I have an XML file and am able to retrieve by var TV= from Tin xmldoc.Descendants("{urn:Import}T")select T; Now if I use foreach (var eachin TV){} it iterates..but ..the actual elements are in TV.Elements (eq: TVID, TVStatus etc). It looks like it is another level deeper..I am trying to get TV..for TVID = 6 and update TVSTATUS to say 1 from previous value.
I have a question regarding how to retrieve an mp3 file stored as a byte[] array from the database and display it in a form and let the user to download/play it?
I have made a document uploading page, In which use can upload their document. I am saving three fields in the database,
Document Name [NVarchar] File [Image] DocumentType [NVarchar]
Now, I am able to add records in the database, successfully. Now I want to show it in the gridview, like DocumentName, DocumentType and a link to download the file.
I have tried by retrieving the records and assigning them to the gridview but I am getting only two columns.
I'm trying to parse a HTML file to retrieve certain info in my asp.net app. I've looked at the html agility pack but found that also quite difficult. :-) As my HTML should be pretty standard I'm hoping regex is quick and easy. I need a regex that will look through the html file (which I've loaded into a string) and find the below line and take out the DATATOEXTRACT (which will be some sort of text, the name of a recipe in this case) so I can put it into a variable:
I have a database table that works as a file repository. Currently there are binaries stored in there and I want to pull the "large" ones out in chunks. Some of these files are in excess of 500 MB. I have business rules that dictate if the file is >5MB to transmit in chunks. <5MB and I can load into memory and rip out. I got the uploading in chunks to work, but how do I get it to pull it out of the DB in chunks?
Right now I'm getting hit with a 'System.OutOfMemory' exception. But when I recreate the byte array of the SAME size (empty though) it doesn't break.
Download Chunks (DAL)
public byte[] getBytesByDataID(int chunkSize, string dataID) { string query = "SELECT data.data " +" FROM data " + " WHERE dataID = @dataID"; openConnection(); cmd = new SqlCommand(query, myConnection); cmd.Parameters.AddWithValue("@dataID", dataID);
I want to include some pie charts present in my power point file. Can any one tell me how to do that? or atleast help in creating pie charts on my web page.
I am having one Event Registration form in that I need to provide one control with which user can attach file it may be pdf file or jpeg(Image). Any sample so that to save pdf file or Image file in DB and how to retrieve it.
In my company one of the applications is a classic asp based application.In this application one the .asp has a Class Definition and a function associated with the class.I want to use this class an aspx.cs page.Is it possible to do this and how
i am doing an task about uploading & retrive video file in asp.net. first of all tell me How Can we Upload Video files In sql server? then second one is How Can we displays that uploaded video files in my web page?
First of all, feel free to move this thread if you find it inappropriate for this section of the forum. I placed it here since I intended to use ASP.NET.
So here's my concern...
How do you retrieve a text file from a UNIX workstation? This text file contains information structured like a table (or like a database). I need to create a custom report (in a Windows PC) based on that text file.
I am working on a project (asp.net web application) that takes files from users, stores them and retrieves or shows them back to the user when needed. I am saving files on my file system (drive). When I save images and refer to them in iframes, images are being displayed in iframes. But when I save .html file and refer it in an iframe it is not displaying the html file. I want to store a .html file on my file system using file upload and store on my local drive, display it in an iframe.