Web Forms :: Parameter Error In The Web Based Application?
Sep 28, 2010
I am working on a web based application wherein I have a created 2 dropdown lists for the user to select. If the user does not select any value from any or both of the dropdown lists, they should see a message- 'Please a select a value for trade code' or 'Please a select a value for direction'. Instead I am getting this development error:
'Procedure or function 'usp_AdminPageCustomerGroupingSearch' expects parameter '@tradecode', which was not supplied.'
As I am still novice to asp.net or C#, I am unable to find the correct code to catch this error and display the relevant message to the user. Could someone please help me with this ? The following is the slice of the C# code which is related to the dropdown list:
In my asp.net+vb web with access database there is a page which displays data as per query string and the string is PNO and all data is correctly displayed in gridview and dataview. there is a Image1.ImageUrl and i used the following code but it is not working
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Dim PNO As String PNO = Request.QueryString("PNO") Image1.ImageUrl = "C:/wing/Photos/" + PNO + ".jpg" End Sub
I've a page in ASP.NET, whose appearance can change based upon a given parameter(say query string),
How can I achieve this in ASP.NET, Master pages concept won't work here, as even the contents of the page and positioning of the controls on the page can change based upon the parameter.
One solution I can think of is using XSLT, but is there any other solution I can use to solve this problem? Is there any concept of templates I can use here?
I have a pop up window which contains a listbox. The items on the listbox should be filtered when it is opened based on the other parameters on the parent page. I am using session to pass the values from a page to another.
I am developing a module for insert watermark in pdf file in asp.net with c# and I want to insert this module in existing application which is based on MVC architecture. I am new in mvc architecture. Can I merge asp.net based module in MVC based application.
I have an ASP.NET3.5 (C#) ASPX page that is internationalized in 10 different languages.
The page is very complex in its structured with dozens of nested views driven by a state machine pattern.
EDIT: I am using the meta:resourcekey syntax in every asp control, which allows to use declarative syntax for Implicit Resource expressions.
I have been asked to "brand" the page based on some query string parameter. Branding will mean not just loading different CSS files, but also having different text blurbs (in all languages).
Is there an easy way to "swap" resx files without having to get resources manually for each of the hundreds of literals and images that I have on this page?
In other words, let's say I have the following RESX files:
I have a requirement whereby I need to be able to change the controller being used based upon a parameter. I am creating an application that needs to be dynamic enough to be able to change controllers on the fly. Let me explain further;
When the application starts a dictionary of custom controller names is loaded with a controller name as the key and a custom controller name as the value. This will be help in the application scope.
When a request is made I need to access the requested controller name, use that name and check to see if it matches a key in my controller dictionary and if so, replace the requested controller name with the custom controller name from the dictionary.
example;
My dictionary will contain data as follows Key: 'Home', Value: 'Home_IN' Key: 'Customer', Value: 'Customer_BE'
Now, the following request is made 'User/Edit/1'. Does the controller name exist in the dictionary? No, continue with original request.
Now, the following request is made 'Home/Details/2'. Does the controller name exist in the dictionary? Yes, replace the original controller name 'Home' withe custom controller name 'Home_IN' so changing the requested URL to be 'Home_IN/Details/2'.
Does this make sense?
My problem here is knowing exactly where in the request cycle I need to do this?
I am assuming I need to create my own custom controller factory?
I made one application which consumes WCF service and also using nettcp protocal. As we know, WCF application requires .Net3.0 and .Net 3.5 framework. but we have some dealer machine which are having window server 2000 OS now i am not able to install .net 3.5 framework on dealer machine . So we are not able to upgrade old application with new application which are totally based on WCF framework .
How can i check a parameter value and add onto or remove conditions from my where statement.Here is what i mean.. i have a stored procedure that is being used for returning small set of fields based on a parameter that it is expecting. Since the only difference between the select statements are the last AND condition, i was wondering if i can check that parameter as im doing now but change that AND condition so that i have only 1 select statement instead of 3 within my procedure.Current Example:
I need to check if any rows are returned in a QueryString here's what I have so far.not sure what code to put to see if the row count is greater than 1
private void BindDataToGrid() { //MessageBoardEntities3 is ThemeableAttribute connection string name int TID = Convert.ToInt32(Request.QueryString["ThreadID"].ToString()); // if Post ID is int var context = new MessageBoardEntities3(); gvPosts.DataSource = from p in context.Posts where p.ThreadID == TID select new { p.Post1, p.PostID }; gvPosts.DataBind(); lblNoPosts.Text = "No posts found for this thread."; }
I want to create a common unit test function to check all functions based on parameter
for e.g
[code]....
what logic should i write inside this method so that by passing a actual function in parameter methodname and then the common method should execute that function and should return the output.
i am using entity framework for all functions which has been created in my project and now i dont want to create a separate unit test function for each function.just one function should do the job based on different parameters...
I need to set up the slide show based on a querystring parameter. I thought I had this figured out, but I clearly don't understand something about how the webservice works. I have this in the .aspx page:
I have a gridview with some text-box columns and one dropdownlist-column (Templatefield).
With the dropdownlist i wan't to be able to edit a cell in a row. I have read a lot on the web and i have folowing code. I only get a parameter error now, before i added the dropdownlist everything was ok.
This is my html:
[Code]....
This is my update-command in the class "TransactiesDAO"
[Code]....
Look at the line:
[Code]....
in the aspx code. I don't now what to type in the "Bind(...)" text.
With above i get error: Message=DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Subrubriek'. when trying to update the row.
When i delete the line "SelectedValue=" then i get folowing error:
It gives me folowing error:
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateTransactie' that has parameters: Rekening, Omschrijving1, Omschrijving2, Boekdatum, BedragBij, BedragAf, Subrubriek, @ID_SR, ID
I have a website that I am trying to configure the ReportViewer for. I need to be able to pass the parameter by way of a querystring. I have setup the report, the datasource and everything functions as it should when I hard code the parameter value. However, when I create a querystring on a separate page, the report displays the error:
i have classes of my web application only the default one work if i for example click a link to go to another class i get this error for each class this happens . But only on the web server WHy ?
Server Error in '/' Application.
Parser Error
Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'WebApplication2.Login2'.
Source Error:[Code]....
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login2.aspx.cs" Inherits="WebApplication2.Login2" %>Line 2: Line 3: Source File: /Login2.aspx Line: 1
I am using the exception catching procedure which is the module to track the errors and it write the error description in a log file in the server.I want to display the error details in a common Error page which is having a multi-line textbox from the common function in the module.Is it possible to do that.If possible,How can I do that....
Try
;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;
Catch ex as exception CreateLogFile(Ex) End Try
The above description is the error catching portion from the code In the module I have written the CreateLogFile function which write the log file. I want to display the Error Page after writing the log file which should contain the error details....
LinkButton lnkHistory = (LinkButton)sender; int ID = Convert.ToInt32(lnkHistory.CommandArgument); ReportDocument rp; DataSet ds = new DataSet(); SqlConnection con = new
when i try to login i get this error Server Error in '/' Application.
Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error: [Code]....
Stack Trace: [Code]....
[IndexOutOfRangeException: Index was outside the bounds of the array.] login.ImageButton3_Click(Object sender, ImageClickEventArgs e) +775 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +86 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
I have an asp.net page where I get the user_id from who's logged in. Now I need to pass this user_id to a flex application that runs in an asp.net page as a .swf. How can I get this user_id in a variable in my flex application. Or what is the best way to get the user_id into flex.