asp.net

Specified cast is not valid. enum

whats wrong with this code, i try also Enum.Parse but didnt work. public enum RoleNames { Administrator, [Description("Personnel Security")] PrsonalSecurity, } foreach (RoleNames roleName in arRoles) //<<<error { if (IsCurrentUserInRole(roleName)) { return true; } } arRoles is ArrayList of RoleNames, which is pa...

How to set the ConnectionString for a SqlDataSource when a configsource is specified in the web.config

I want to be able to quickly create some simple ASP.NET reports that don't have a code behind file. Each report will be an aspx file that may have multiple SqlDataSource controls on it. I want to be able to use the <%$ ConnectionStrings:MyTag %> syntax to set the connection string but, the application we're using has the actual connectio...

ASP.NET Ajax and Jquery ThinkBox

Hi, I am having a problem running ASP.NET Ajax and Jquery side by side. when the page load jquery thinkbox work, but as I update the asp:repeater control with ASP.NET Ajax, then Jquery ThinkBox stop working. I just dont know why. please help Regards ...

out of proc COM server unable to createobject from asp.net webservice

I have the following setup WinXP SP2, IIS 5.1 I have an Asp.net website(a) calling -> Asp.net Webservice(b) calling a function Creating a COM object in an already running EXE server(c). This COM server works fine with local clients. The CreateObject fails even when run on a machine when COM server is registered as a user(adminuser) w...

NHibernate log4net performance problem - how to disable?

I was profiling our ASP .NET application to try and reduce the CPU usage and fond some strange behaviour regarding NHibernate and log4net. Over 50% of the time on our app is spent in the log4net GetLogger and CreateRepository methods, which are called from ExecuteReader in NHibernate. The screenshot below is a jetBrains dottrace hotspot...

Urlrewriting.net IsPostBack always false

I am working on rewriting URLs Urlrewriting.net, and have run into what seems to be a common problem but I can seem to fix it. I'll present a simplified case. The URL rewriting is working perfectly with the rule: <urlrewritingnet rewriteOnlyVirtualUrls="true" defaultPage="default.aspx" defaultProvider="RegEx" xmlns="http://www.urlrewri...

trying to send pix to verizon cell @vzwpix.com, getting removed

I'm trying to make a small service so I can send myself photos from my computer to my phone willy nilly, something probably already does this but I like trying to do things on my own. Everywhere I look online tells me I can send a picture as an email attachment to [email protected] and that'll work, however every time I do it my TXT m...

What is difference between web.config assemblies element and project file Reference element

hi, I'm looking at an asp.net application, i notice that there are assemblies defined into two places. In web.config there is configuration/system.web/compilation/assemblies/add elements. In the project file there are references setup under the Project/ItemGroup/Reference elements. I was wondering, what is the difference between assemb...

Web service method returns Response object instead of custom object

I have the following code: [WebMethod] [SoapHeader("_webServiceAuth")] public User GetUser(string username) { try { this._validationMethods.Validate(_webServiceAuth); User user = new User(username); return user; } catch (Exception ex) { ...

ASP.NET NHibernate transaction duration

Currently in our ASP.NET app we have 1 session per Request, and create one transaction every time we load or update and object. See below: public static T FindById<T>(object id) { ISession session = NHibernateHelper.GetCurrentSession(); ITransaction tx = session.BeginTransaction(); try { ...

radiobuttonlist alignment

Does anyone know how to make a radiobuttonlist appears horizontally with text on the bottom, in ASP.Net? . . . Option 1 Option 2 Option 3 ...

How to set path in config file

Hi, I have a test which runs a script. It gets the path from the app.config file: <scriptsSectionGroup> <scriptsCollection> <scripts> <add name="TestScript" path="C:\My Projects\RestServicePublishing\UtilityFixture\testScript.bat"/> </scripts> </scriptsCollection> </scriptsSectionGroup> 'testScript.bat' i...

writting data into asp.net page in xml format using C#

Hi everybody I want to show my data to a asp.net Page using c# in XML format Plz anybody send some example with code. like - <person> <email>[email protected]</email> <dob>YYYY-MM-DD- HH:MM:SS</dob> <city>XYZ</city> </email> </person> So plz send some code with a good example. Thanks in Advance ...

How to modify the POST data in javascript?

I have a scenario like below: I navigate to the reader page with the below form data <form id="mainForm" action="Reader.aspx" method="post"> <input type="hidden" id="bookId" name="bookId" /> <input type="hidden" id="startPageId" name="startPageId" /> </form> Initially the hidden variable values will be bookId=1 and st...

Jquery problem in IE

when i am using mbScrollable.js file,my buttons are not working.when i click on button it is giving me error "State information is not valid". when i comment this all buttons are working fine. Is this the problem of mbScrollable.js file.i am using mbScrollable.js version: "1.5.7".It is giving problem in IE only.in mozilla it is working ...

Multiple Button in a single view

hi, I have a web project which includes two button in a view.when i click a button some textboxes along with that second button have to be visible.After entering data in textboxes,when i am trying to click the second button, its not working.What should i do to make it work? Thanks in advance. ...

GridView Hide Column by code

Hi all, I want to hide ID column in my GridView, I knew the code GridView1.Columns[0].Visible = false; but the surprise was that my count property for my GridView columns is 0 !!! while I can see data in the GridView, so any ideas? Thank you, Update: here is the complete code for the method which populate the GridView public Dat...

ASP.NET Application ending immediately after starting

Having a bit of a problem with my hosted ASP.NET applications. I noticed slowness when opening pages, the kind of slowness that you see the first time you start up an ASP.NET app. After researching, I'm finding that the Application_End event is firing shortly after the application starts, apparently killing the sessions, static values, e...

inserting data from a asp.net page to sqlserver database

hi, there are two tables in database. one is 'books' with 4 columns pkid,title,price,writer(int) and other is 'persons' with columns pkid, name,value(int). one asp.net page is there with text boxes named title,price,writer and a submit button. i want that on filling that writer txtbox with some name which is available in 'pe...

any simple example of doing javascript dopostback and its pros and cons.

Hi everybody anybody plz the information of do postback details. ...