I have an ASP button for which I have set the OnClientClick property to display a javascript confirm message. However, I only want this message to be displayed AFTER all of the client side validations have passed.
How can I do this? Essentially, I believe that I need to force Page level validation from the client and then, only if it passes, display the confirmation box.
I have configured a Virtual Directory on IIS 6.0 running under UserA.
AppPool for the same is configured under Network Services.
I have one WCF svc file running under it,
My question is:
Is it running on UserA Account Or Network Service?
I am populating a table based on a javascript function. I want to limit the data entered to 2, afterwhich I hide the table. Is there a way to track how many hits the javascript code gets hit?
function addNewRow() {
$('#displayInjuryTable tr:last').after('<tr><td style="font-size:smaller;" class="name"></td><td style="font-size:smaller;" class="address"></td></tr>');
var $tr = $('#displayInjuryTable tr:last');
var propertyCondition = $('#txtInjuryAddress').val();
$tr.find('.name').text($('#txtInjuryName').val());
if (propertyCondition != "") {
$tr.find('.address').text($('#txtInjuryAddress').val() + ', ' + $('#txtInjuryCity').val() + ' ' + $('#txtInjuryState').val() + ' ' + $('#txtInjuryZip').val());
}
Hi there,
I'm doing a little app that basically has 2 text boxes. You'll enter Fahrenheit into TextBoxA and Celsius into TextBoxB.
As the text changes in TextBoxA I want the equivalent Celsius value to be displayed in TextBoxB and vice versa.
I can come up with a solution pretty easy for this but i'm trying to be a little clever.
Is there a way to do it all in Xaml except for a Convert class that does the maths? So basically I want the TextChanged event of one textBox to pass in it's value into a Converter class that is evaluated and sent to the other TextBox and visa versa.
Anyone know how I can achieve this ... and if it's possible at all?
I have 2 generic Lists List<type1> L1 , List<type2> L2 in C# 3.5
Problem: type1 has an attribute called "key1" and type2 has an attribute called "key2"
How to merge L1 and L2 on key1 = key2.
Both lists are unsorted but I'm welcome to any ideas on how to sort the lists based on the attribute.
I'd like to be able to merge the two lists on a key. I know it's not a dictionary and it would've been nice if it was but there is a very specific reason why they are lists which I will not get in to because that is irrelevant.
VB6 & SQL Server 2005
When i run the Windows based Software exe file,
it is showing the login page,
after login page - no screen is displaying,
I checked the task manager, in task manager it is showing as software as running,
But there is no page is appearing.
Is any firewall blocking or some other issue. But software is running with out displaying anythings.
How to solve this issue?
I use SPs and this isn't an SP vs code-behind "Build your SQL command" question. I'm looking for a high-throughput method for a backend app that handles many small transactions. I use SQLDataReader for most of the returns since forward only works in most cases for me.
I've seen it done many ways, and used most of them myself.
Methods that define and accept the stored procedure parameters as parameters themselves and build using cmd.Parameters.Add (with or without specifying the DB value type and/or length)
Assembling your SP params and their values into an array or hashtable, then passing to a more abstract method that parses the collection and then runs cmd.Parameters.Add
Classes that represent tables, initializing the class upon need, setting the public properties that represent the table fields, and calling methods like Save, Load, etc
I'm sure there are others I've seen but can't think of at the moment as well. I'm open to all suggestions.
I'm replacing a website that was previously HTML only.
I put a GridView on the French and the English page and I'm getting 2 fields: A date and a currency.
For the date, I need to transform it into a long date format. The English part isn't very hard, but when I get to the French page, I can't transform it into a long date format with French words (i.e.:Mardi instead of Tuesday).
Is there any way to format the string with French date words instead?
Hi
I am wondering is this normal when you add this into your web.config
<location path="." inheritInChildApplications="false"> </location>
The debugger should stop working. Like when I add this to my site and try to run in debug mode it won't activate any of my debug points nor will it lock up Visual studios 2008. I can have it running and still make edits to my C# code.
I take the line away and I get the debug mode back and it locks up VS2008.
I am facing an issue in my application user directly clicked on browser close [X] button. Browser can be IE, Chrome, Mozilla, Firefox and many more.
What I want to do :
1. as soon as User hits [X] button of browser, need to set there status as logged off in database for which we have a method in Login.aspx file which is within the masterpage.
2. We do not have any Logoff feature in the application
I will be thanlful if anyone suggest a solution to call the method which sets the user status as logged off from master page.
Thanks in advance.
Hi,
I have an existing application that i want to implement password resets after 30 days.
But i dont want the user to use the same password as the last 5 times.
How do i go about doing this or is there any links i can follow.
Please help
Thanks,
I am trying to bound combobox to a collection. Collection is returning 3 cols. How do I a specify DatavalueField and Datatextfield to 2 of the columns returned in my collection?
When I write following code Combox is populated with text showing MfnBusinessData.Item for each item.
Thanks
Dim ItemCollection As Collection(Of MfnBusinessData.Item)
Dim oms = New MfnDataAccess.LookupDal
ItemCollection = oms.GetLookupItems("OFXQuestionText", "FULL", "ALPHA", "en")
RadComboBox1.DataSource = ItemCollection
RadComboBox1.DataBind()
'RadComboBox1.DataValueField = ItemCollection.Id
'RadComboBox1.DataTextField = "Text"
Hi,
I need to be able to provide a page for the end user where thay can search in the following :
Search work
Category
Price
AdType
Location
and so on.
Its important that the user can copy the url and then use it later(and get the same settings). Its also important to be able to save these settings on the user in the database.
So far I have created a ModelView class that contains the parameters but I am not sure that this is the right way to go? Maby I should pass all inte the URL.
If so, how do I accomplish this? Is there any samples I could look at?
BestRegards
There may be an easy way to do this but I can't see it...
I created a simple Http Module that starts a timer on the PreRequestHandler and stops the timer on the PostRequestHandler to calculate the time it took the page to load.
I then create some simple html and write my results to Response.Write. Since I'm doing this in the PostRequestHandler it's adding my results after the </html> tag. That's fine for testing but I need in a scenario where the page needs to validate.
I can't seem to figure out how I could manipulate the Response object to insert my results before the </body> tag. Response.Write and Response.Output.Write don't have that flexibility and I couldn't see a way to work with the Response as a string. Am I missing something easy?
Sometimes I do this and I've seen others doing it too:
VB:
Try
DontWannaCatchIt()
Catch
End Try
C#:
try
{
DontWannaCatchIt();
}
catch {}
I know I should catch every important exception
and do something about it, but sometimes it's not important to - or am I doing something wrong?
Is this usage of the try block incorrect, and the requirement of at least one catch or finally block an indication of it?
For my Contact class, the property EmailAddress is marked with the [DataType(DataType.EmailAddress)] attribute.
In my view, using Html.Display("EmailAddress") and Html.DisplayFor(c => c.EmailAddress) yields different results. The former outputs a mailto: link, which is the expected behavior, while the latter simply outputs the email address as plain text.
My question is why the different behavior, I expected these two methods to have the same output.
Hi,
I have 24/7 service which keeps setup (configuration data) for charging, routing and etc in the Sql Server. Once it is started it loads the data from table using Linq2SQL and use the data through all the application.
And we need a solution to update the setup data in the table without restarting the application. So I am interested is it possible to catch/determine that the table was updated so I can refresh the setup data in the application. I mean is it possible to have events which will raise when there is any delete, update or insert on the table.
Thank you.
I am getting the MOdel.StudentID from data base in my view..
I need to put this StudentId in textaren?
<textarea> ?? </textarea>
how to assing this value?
so that in textare I can see StudentID?
thanks
I have a Dictionary<string,int> and I simply want to decrement the value in my dictionary by one.
I have this but not sure if its best practice.
foreach (KeyValuePair<string, int> i in EPCs)
{
EPCs[i.Key] = i.Value - 1;
}
If System.IO.Directory.Exists(HttpContext.Current.Server.MapPath(Server.MapPath("images/TravelogueGallery/" & getMaxID()))) Then
System.IO.Directory.Delete(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID()), True)
End If
I am using the above code snippet to delete a directory but i get this error "'G:\Projects\Latest\LTCIndia 05-04-12 1415\images\TravelogueGallery\19' is not a valid virtual path. "
Whats wrong with the code?
In the Session_Start i have
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Session("login") = False
End Sub
and in a custom .aspx page i included the following...
Public ReadOnly Property GetLoginState() As Boolean
Get
If Current.Session("login") Is Nothing Then
Current.Session("login") = False
End If
Return Current.Session("login")
End Get
End Property
Why i am getting error the error
Object reference not set to an instance of an object.
at line
If Current.Session("login") Is Nothing Then
while checking for the login state as follows?
If GetLogin = False Then
'Do something
End if
I mean i have already created the instance on the Session_Start... Haven't i?
What am i doing wrong here?
I would like to be able to do such things as
var m1 = new UnitOfMeasureQuantityPair(123.00, UnitOfMeasure.Pounds);
var m2 = new UnitOfMeasureQuantityPair(123.00, UnitOfMeasure.Liters);
m1.ToKilograms();
m2.ToPounds(new Density(7.0, DensityType.PoundsPerGallon);
If there isn't something like this already, anybody interested in doing it as an os project?
I have a string in my database that represents an image. It looks like this:
0x89504E470D0A1A0A0000000D49484452000000F00000014008020000000D8A66040....
<truncated for brevity>
When I load it in from the database it comes in as a byte[]. How can I convert the string value to a byte array myself. (I am trying to remove the db for some testing code.)
I have asp:RegularExpressionValidator with ValidationExpression="\d+{1,4}(?:[.,]\d{1,4})?" but it doesn't' work, parser throws ArgumentException:
parsing "\d+{1,4}(?:[.,]\d{1,4})?" -
Nested quantifier {.
Where is my mistake? I want to allow strings like xxxx,xxxx - from 1 to 4 digits and decimal digits are not required, e.g.: 1000, 99,99, 0,2498, etc.