I have a simple method which takes an Object and return string "No" or "Yes". Basically I want to display "Yes" or "No" when a bool value of 0 or 1 is there
But everytime there is a 1 passed to the CheckValue which in the debug shows as true, It never evaluates being equal to "true" what am I doing wrong? My Checkvalue is always returning "No" no matter what I pass.
I have an asp:label field for and expire date that should either display "Never" if the database field ([msDS-UserDontExpirePassword] this is a bit - true/false - field) is True, or otherwise display a date (pwdExpireDate).
My code doesn't throw any errors but I can' fully test it without putting it into production. Can someone tell me if this is correct? Also, there is no code-behind and I can't use code behind for this.
I'm setting up a fairly complex gridview, and running into an issue with allowing some keyboard shortcuts to cause a submission postback. I'm hooking the onkeydown event on all of the editable elements within my gridview (in edit mode, as well as a separate-but-similar set of elements in the footer, used for row insertion), and calling the following function:
[Code]....
Here is the definition of LinkButton1, which is within a TemplateField in MasterGridView:
[Code]....
The gridview is not populated until after the user has made some input to the page, so I can't just refer directly to MasterGridView.SelectedRow.FindControl("LinkButton1").UniqueID for my eventTarget within the PostBackOptions (if I run this right now, it'll evaluate to "not initialized". But, I don't know how I could get it to recheck the value after the page has been created. There's gotta be a better way to make this work.
The demo web project that ships with the VS2010 contains a system.web.ui.webcontrols.menu control.
That particular menu includes the IncludeStyleBlock property.
When the IncludeStyleBlock property is set to False the menu is displayed as it supposed to. The menu gets destroyed if i set that property to True. So here is my main question...
Is there any way of preserving the appearence of the menu, with the IncludeStyleBlock property set to false?
P.S. I have to set it to False... since my provider does not support the forth generation of the .NET framework.
i am trying to create a com object using Server.CreateObject in a masterpage. when i do, i get the
The component 'Rsacookieapi.RSACookie' cannot be created. Apartment threaded components can only be created on pages with an <%@ Page aspcompat=true %> page directive.
error. there is no "Page" directive in master pages, so how can i enable this functionality in a master page?
I wanna do some local developer tests of IIS 7 but I don't have Windows Vista, 7 or 2008 server - I currently run XP SP3. I have Virtual PC installed so I can use Microsoft's IE compatibility images - are there any time-limited images that I can use with Virtual PC so I can check out IIS 7? The IIS 7 "Try it" link points to this page. But the VHS is for Windows Server platforms only I think and I don't want an ISO?
I have a boolean column in a datagrid that I would like to display as red/green image (I have already created these) instead of false/true. Or maybe I could display the "True" in green text and "False" in red text. Can someone point me in the right direction?
In my new webpage version I've added ajax toolkit 4.0 and runing framework 4.0, there seems to be some problems with the ToolScriptManager CombineScripts.
I have a MasterPage that all pages derives from and in this MasterPage I have a ToolKitScriptManager with LoadScript.....="false" CombineScripts="true". In my masterpage I've added a ModalPopUpExtender
When I start the webpage I can't show ModalPopUp (www.url.com) but if I go to any other page it works ex. (www.url.com/testpage/), if I disable CombineScripts="false" the the starting page works but then I get so many more httprequests.
It took me a little while to figure this out, but the AllowPaging="true" on the FormView seems to be the culprit. I don't have much experience paging from a FormView, but for this requirement the customers wants this kind of UI.I have a FormView with DefaultMode="Edit", which is bound to an EntityDataSource. One of the entity's properties, "ExternalID", determines whether some of the other properties in the entity are read-only. For example, if IsExternal==null, the FirstName, LastName, and Email fields should be rendered as TextBoxes. If IsExternal!=null, the 3 properties should be rendered in Label controls.
What I need to do is to compare the values for the previous day to see whether it is greater than today's and then return an image in an Image templatefield in a gridview. Below is my gridview:
[Code]....
Basically, the imgUrl method should return the correct indication in the gridview image template field. For instance if the sprice(which is today's values) is greater then the previous an uparrow should appear. However, I notice that the conditions is not evaluating correctly, for instance the Bank_Name FCMB in the table still returns an uparrow even when its share price is down from the previous day value.
I have a page with a detailsview. Not all the fields in the select statement in the connection are present in the detailsview. I'm not sure if that is relevant. But what I want is for the page to evaluate two bits of data from the record it is loading. I have one field called "Controlled" which is a bit field and a field called Username. I am getting the current user by using this code.
[Code]....
I want the page to run an evaluation that goes... if username<>curruser2 and controlled = true then
I try to compare Datetime.Now with a Datetime variable I set, using the Datetime.CompareTo() method. I use a timer to compare these every second and display the result, but as the current time approaches the time I set, the result changes from 1 to -1, but never 0, which means these two are never equal. I'm suspecting the Datetime structure contains milliseconds?
I'd like to be able to achieve this same functionality except to fire when the desired index IS NOT set. I cannot simply create a bunch of Conditions for each index other than the one I specify due to the way this is dynamically being done in my application.
I am trying to split a collection into multiple collections while maintaining a sort I have on the collection. I have tried using the following extension method, but it breaks them incorrectly. Basically, if I was to look at the items in the collection, the order should be the same when compared to the broken up collections joined. Here is the code I am using that doesn't work:
public static IEnumerable<IEnumerable<T>> Split<T>(this IEnumerable<T> list, int parts) { int i = 0; var splits = from name in list group name by i++ % parts into part select part.AsEnumerable(); return splits; } int parts = number of sub enumerables
I keep getting an error:Index (zero based) must be greater than or equal to zero and less than the size of the argument list.y code:
OdbcCommand cmd = new OdbcCommand("SELECT FirstName, SecondName, Aboutme FROM User WHERE UserID=1", cn); OdbcDataReader reader = cmd.ExecuteReader(); while (reader.Read())
I'm facing a problem that Google couldn't solve yet!I'm trying to store URLs in an XML file. Problem is that these URLs contain Equal Signs (=) in them. And that generates an error.Here is my code: (**token is a variable that contains the URL)
Dim child As String = vbCrLf & "<Link URL='" & token & "'></Link>" Dim fragment As XmlDocumentFragment = doc.CreateDocumentFragment fragment.InnerXml = child
The error message: (Error line and position are meaningless here) '=' is an unexpected token. The expected token is ';'. Line 2, position 133.I've replaced all '&' symbols with '&' in case they were the ones causing the error, but no luck so far.
I have a basic web form with about 5 textboxes. One Textbox is "Date1" and the other is "Date2." Is there a way to set the value of Date1 = Date2 after the user enters a value into the Date1 textbox? I'm using Visual Studion and C#. I'm not much of a programmer, so the less technical the better.
I'm trying to pass post data from one page to the next but PreviousPage always equals null.This is what I have in the original page (inside an updatepanel
I have ASP .NET page, and VB module. I have DropDownlist in the ASP page that retrieve information from SQL database. I am trying to make a string varaible equal the value of the dropdownlist selected.
If I want to validate that a text box contains an integer greater than or equal to zero. Do I need to use TWO asp:CompareValidator controls: one with a DataTypeCheck operator and one with a GreaterThanEqual operator?
Or is the datatype operator redundant? Can I just use a single validator with the GreaterThanEqual operator (and the type set to Integer)?
Dim intusercount As Integer = 0 Using connection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True") Using command As New SqlCommand("SELECT [ID] FROM [Members] WHERE [Username]=@Username AND [Password]=@Password", connection) command.Parameters.Add("@Username", Data.SqlDbType.VarChar).Value = TextBox1.Text command.Parameters.Add("@Password", Data.SqlDbType.VarChar).Value = TextBox2.Text connection.Open() intusercount = command.ExecuteScalar connection.Close() If intusercount > 0 Then MsgBox("Good") Else MsgBox("Bad") End If End Using End Using Error:
The data types text and varchar are incompatible in the equal to operator.
Source Error: Quote:
Line 11: command.Parameters.Add("@Password", Data.SqlDbType.VarChar).Value = TextBox2.Text Line 12: connection.Open() Line 13: intusercount = command.ExecuteScalar Line 14: connection.Close() Line 15: If intusercount > 0 Then