Isn't the Bind attribute, preferable the Exclude parameter, define any properties that will be excluded from any form update? If so, why does the ModelState is not valid when I do this?
I've a MDX Query that has where clause as shown below.I'm designing report using SSRS 2008. How can i pass date as parameter? I tried to setup @from and @to as parameter but not working?
WHERE ( {[Date Central].[Calendar Date].[2010-04-01 00:00:00]:[Date Central].[Calendar Date].[2010-08-30 00:00:00]} )
need it to work as WHERE ( {[Date Central].[Calendar Date].[@From]:[Date Central].[Calendar Date].[@To]} )
I have data in ParamList (from SQL reporting services database)which I want to display in a GridView. as ParameterName and VAlue. I am able to retrieve the parameters but can't figure out how to read them into ArrayList (or whatever method you coud suggest) and then bind to grid. Final grid should be like this-
ParameterName ParameterValue Year 1011 Number1 0011 Number2 0101 Number3 0201
Here is the code I'm trying to figure out-
Dim intCount As Integer Dim strparam As String Dim strparam1 As String Dim varResult As Object Dim ParamList as string ParamList = "Year=1011&Number1=0011&Number2=0101&Number3=0201" varResult = Split(ParamList, "&") Dim arrList As New ArrayList() 'loop through array and retrieve parms For intCount = 0 To UBound(varResult) varParam = Split(varResult(intCount), "=") strparam1 = UCase(varParam(0)) strparam = varParam(1) arrList = ??? Next 'and then display tsi data into a grid. GridViewParams.DataSource = arrList
where id is the datakeyname of the grid now i had a requirement to add another datakename as UserId. and i need to have DataBinder.Eval for UserId also.
How am going to use two values in this anchor tag using DataBinder.Eval?
have a search on my site, in which search type and search word are in URL like this: /search/t-someword.htmly route for search:
routes.MapRoute("Search", "searchj/{type}-{word}.html", new { controller = "Search", action = "Index"}, new { type = @"[t,s,p]"});
Everything works fine but when I change string to do not show spaces that word like "some words" looks like "some-words" it doesn't work. With spaces it works
I am using the stored procedure below for the select command of a SqlDataSource, and I'm trying to pass a query string parameter, but I get this error:
Procedure or function 'ActivationCampaignGetById' expects parameter '@campaignId', which was not supplied.
I am using the stored procedure below for the select command of a SqlDataSource, and I'm trying to pass a query string parameter, but I get this error:
Procedure or function 'ActivationCampaignGetById' expects parameter '@campaignId', which was not supplied.
I've got a .aspx and in it an .ascx. In the .ascx I have a server control.
The .aspx has a list of items in a cart The .ascx has a list of some cross-sell items (fed from a custom server control) that the customer can add to the cart if desired both the list of items in cart and list of cross sell items are driven by a repeater and bound on page load. So the .aspx calls a method that rebinds the cart items on page load. And the .ascx calls a method in its page load that rebinds the cross sell items in that custom control (.cs) that is in my .ascx.
The problem I have is, when the user clicks a "add to cart" button in the repeater inside my custom control, the page refreshes and what should happen is the cart items in the .aspx AND the list of cross sells should refrsh showing that the cross sell item was moved to the cart. But even though when I debug and I see the list being rebound with the corret # of items after the move, the page still shows the old state. I have to refresh the page manually again to get it to work.
I guess I need to check for Page.IsPostback? but even if I don't check that..at the least both lists should be refreshing regardless cause I have it in my page load. So even if it's a postback, and I'm not checking for that the lists should show the new state because I'm not even checking for postback anyway. So checking for postaback I don't think is the issue here cause i want the lists to rebind and re-update on any page load....initial or if it's a postback...it doesn't matter. Reload every time. But it doesn't seem to be doing this even though I clearly see the revbind of the lists having the right count (one less on the cross sell and one additional to the cart as it was added after the user clicked the button).
Here's the sequence of events:
User is on their cart page User sees a list of cart items that they have added to their cart already (this list is bound in the Cart.aspx and rebound on every page load)User sees a list of possible cross sell items they can add to their cart somewhere on the page. This list is a custom control found in my .ascx and that .ascx is obviously in my .aspx.
The custom control is just a repeater that lists out the cross sell itemsUser clicks one of the "Add to cart" buttons on one of the cross sells Page refreshes. In the page load of the .aspx AND the .ascx, I am going out to the DB and rebinding both those lists based on the new state...that is, the new lists after the item was added to the cart which means that now the cart items should have one more added to the list and it does...I clearly see that the new list has one more.
The page comes back after the refresh but I don't see the lists reflecting the new state...I don't see the new item in the cart items list and the added cross sell removed from the cross sell list even though again both lists when I debug are showing correct set of records reflecting the new state.
protected void ddOne_SelectedIndexChanged(object sender, EventArgs e) { PopulateType(); } private void PopulateType() { DataSet dstype = new DataSet(); //Assign DataSet by stored procedure that is working correctly and //DataSet has values that I want to ddType.DataSource = dstype; ddType.DataTextField = "Name"; ddType.DataValueField = "ID"; //I have watching values in visual studio.net and its working perfect //using QuickWatch and breakpoints ddType.DataBind(); }I have to give data source and bind a dropdownList with the event of another dropdownlist ....At code it is working good but At webpage, It is not showing the DropDownList.
I was expecting a parameter will become a empty string value if the parameter is missing, but it turn out to be null. have I done it wrong for the optional parameter?
ImageID=@id error myust declare @id ImageID=id invalid column id ImageID=?id incorrect syntax at ? all errors occur at SqlDataReader Dr = Cmd.ExecuteReader(); int id = Convert.ToInt32(Request.QueryString["id"]); string SQLquery =""; if (id == null) { SQLquery = "Select Top 1 ImageData,ImageType from WebBGImages ORDER BY NEWID()"; } else { SQLquery = "Select ImageData,ImageType from WebBGImages where ImageID=@id"; } SqlCommand Cmd = new SqlCommand(SQLquery, connection); SqlDataReader Dr = Cmd.ExecuteReader();
I am trying to get the uniqueidentifier value from a insert SP and retreive that using a sqldatasource and pass that value to store files in the relevent folder.
I have a system in which users can enter records into a database via ajax. Each user may hold many values in the database, with different pageId and itemId values. Each user is identified by a GUID set to a cookie. The system needs to prevent the user from entering two pieces of data with the same pageId and itemId, so I've created a script to do two database updates:
Firstly, all records are deleted from the database where the memberGUID, pageId and itemId fields match (i.e. they've already added this item).
Secondly, the record is then recreated.
It all works brilliantly, except when the GUID value is passed into the delete statement, then I just get a caught exception.
So this works:
[Code]....
But this doesn't:
[Code]....
The weird thing is that because the GUID value is being saved in the second database call, it is definitely there and is definitely the right data type etc. Even if I hard-code it into the delete procedure it still causes the whole thing to fail.
why it's failing when I add the GUID parameter in the deletion process?
On EDITION form I have only fields: 'title' and 'message' (without field 'link'), but for 'link' is still triggered validation. How can I exclude 'link' from validation in action. I have tried:
[Code]....
But this doesn't work. I still see: "The link field is required.". What is the solution ?
string pattern = "<(.| )+?>"; System.Text.RegularExpressions.Regex regEx = new System.Text.RegularExpressions.Reg(pattern); string result = ""; result = regEx.Replace(htmlText, "");
In this "htmlText" will have some html code which also contains break tags. Right now its replacing all the html tags, but I want to leave break tag and replace the rest.
I'm attempting to serialize an object but I would like to exclude one of the objects inside it. I've tried [NonSerialized] and it is still attempting to serialize it when I call XmlSerialize on a Cart object.
[Serializable] [XmlRoot("Cart")] public class Cart : ICart { // Public Properties [DefaultValue("")] public string ID { set; get; } [XmlIgnore()] [NonSerialized] public CartSerializer Serializer = new CartSerializer(this); }
On my MasterPage I use UpdatePanel to update whole ContentPlaceHolder. Example of code you can find below. All content pages work fine with this MasterPage except one. This page is very complex. I noticed that when I disable UpdatePanel in my MasterPage this problematic page works fine. Question: is it possible to exclude something from UpdatePanel - in my example whole page but only this one?
public virtual DateTime CreatedDate {get; set;} public virtual string CreatedBy { get; set; } public virtual DateTime UpdatedDate { get; set; } public virtual string UpdatedBy { get; set; }
I've implemented a EventListener (IPreUpdateEventListener, IPreInsertEventListener) so that I can fill these properties before inserting/updating my entity.I do not load my entity just before saving cause I've got all my fields in a view (id, version). The only thing I would like to avoid to put in hidden fields (of my view) are CreatedDate and CreateBy.Since I fill these fields only once, when the entity is created the first time, I was wondering if there's a way to exclude them when I update (only update) my entitiy?!
I have a VM which contains a DTO inside it and DTO again contains properties.
it is like this :
[Code]....
Now i attach this VM to a View and expect the contactPersonVM as parameter. I am using same View for both Create and Edit. When in Create Mode i don't want SysId property to be attached as it is not required in create Mode.
This is the code for create action:
[Code]....
Though i have Excluded SysId from Binding but its still giving me ModelState error of "SysId is required". If i attach a Bind attribute directly to ContactPerson DTO then it works but then it applies for both Create and Edit. I want Bind attribute to be only for Create Action.