|
Leona T wrote: i am even willing to pay i need this project
goto to rentacoder.com .
|
|
|
|
|
hi all,
i have requirement to find previous date
my input will be month and year,
for eg: 01/2009, it should return the month and year exactly six months back
i.e 07/2008,
how to solve this,
winnie
|
|
|
|
|
Just create datetime types in .net with your current dates
and then use AddMonth with -6 parameter!
try it,just two line of code
Human knowledge belongs to the world
|
|
|
|
|
|
Should have made him work for it, its too simple of a question
only two letters away from being an asset
|
|
|
|
|
Learning to RTFM[^] can AddMonths to your career but AddMonths could be negative as well
only two letters away from being an asset
|
|
|
|
|
Hi all,
some of my files are corupted(damaged) in XP.can any one tell me how to repair it or recover it ???
Thanks in advance...
|
|
|
|
|
|
sarangkhandare wrote: some of my files are corupted(damaged) in XP.can any one tell me how to repair it or recover it ???
How does it related with ASP.NET ? You are in a wrong forum !!
|
|
|
|
|
Why don't you repair you installation?
Cheers!!
Brij
|
|
|
|
|
My config:
VS 2005 Pro with SP1
C# 2005
.NET Framework 2.0 SP2
Vista Ultimate SP1 all current patches applied
P4 3.0ghz w/ 1.5GB RAM and (1) 300GB disk w/ 27.5GB free (system/boot disk), (1) 400GB disk w/ 74GB free
Problem: no matter how simple an app I create, debugging does not work - i.e. I can set a breakpoint that I know is crossed but the app does not fall into the debugger. These are .NET web apps. I created one with a single form and created several breakpoints, one in Page_Load against a simple string which I programmatically set a value for and one in an asp:validator that I know is hit and passed.
VS even asks to set the app for debugging, and IE is set to show scripts, etc.
Can someone help me to understand what I'm missing and why I can't debug anything simple or complex? You can probably imagine this is making me crazy and I'm having to write data to textboxes just to see what's happening when something goes wrong. Some things I just can't test for at all because of this.
Thanks in advance!
|
|
|
|
|
Hi Mike..
<%@ Page Language="VB" MasterPageFile="~/........"
AutoEventWireup="true" CodeFile=".....aspx.vb" Inherits="......" title="....." %>
Change autoeventwireup to TRUE and try....
Regards
Rajeesh MP
|
|
|
|
|
Unfortunately, all pages have AutoEventWireup="true", here's a sample of a simple app page:
<![CDATA[<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ValidaTest._Default" %>]]>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Pick a Team Name</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2>Pick a name for your team</h2>
Name:
<asp:textbox id="txtTeam" runat="server" xmlns:asp="#unknown" />
<asp:button id="btnValidate" runat="server" text="Go" xmlns:asp="#unknown" />
<br />
<asp:requiredfieldvalidator id="reqval_txtTeam" runat="server" xmlns:asp="#unknown">
ErrorMessage="You must enter a team name."
ControlToValidate="txtTeam" Display="dynamic" />
<asp:customvalidator id="custval_txtTeam" runat="server">
ErrorMessage="That name is already taken. Please pick another."
ControlToValidate="txtTeam" Display="dynamic"
OnServerValidate="custval_txtTeam_ServerValidate" />
<asp:label id="lblResult" runat="server" enableviewstate="false" />
</asp:customvalidator></asp:requiredfieldvalidator></div>
</form>
</body>
</html>
Thanks for trying - it seems to be something deeper. When I press f5, everything executes, just no stopping at breakpoints. The Build is set to Debug as the active, DEBUG and TRACE constants are defined, it's set to full debug mode, any CPU and platform and the ASP.NET debugger is checked.....
Strangest thing.....
|
|
|
|
|
i had same problem, it solved by when i start dotnet framework by right click and run as administrator on VS sort cut or on programs.
you may try this.
Anshuman Singh
|
|
|
|
|
Thanks - that was the answer - for whatever reason, even though my Vista ID is an Administrator, I have to explicitly start VS by running as an Admin by right-clicking. Thanks for fixing me up!
|
|
|
|
|
hi Anshuman..
thatz a good one..Thanks for the information
Regards
Rajeesh MP
|
|
|
|
|
<br />
<br />
CS1502: The best overloaded method match for 'System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(string, string)' has some invalid arguments<br />
<br />
Source Error:<br />
<br />
<br />
<br />
Line 27: <br />
Line 28: objLogin = new STR_USERS(); <br />
Line 29: objLogin.PASSWORD_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword, "MD5"); <br />
Line 30: objLogin.USERNAME_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtUserName,"MD5");<br />
Line 31: <br />
I don't why I got this error.
|
|
|
|
|
amistry_petlad wrote: Line 27:
Line 28: objLogin = new STR_USERS();
Line 29: objLogin.PASSWORD_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword, "MD5");
Line 30: objLogin.USERNAME_PRO = FormsAuthentication.HashPasswordForStoringInConfigFile(txtUserName,"MD5");
Line 31:
Assuming txtPassword and txtUserName are TextBox controls, you need to call the .Text property on them. If you attempt, as you have done, to pass references to the controls themselves, you get a compile-time error because the method was expecting an instance of a string, not a TextBox control.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello Everyone,
I am a newbie to the world of ASP.NET and I am trying to create a web based questionnaire/test. The user clicks on a link to start the test and the page that presents itself has questions and appropriate input control (text box or checkboxes, etc) for the user to answer. Based on the type of test that user selects, I have to present the form which gets questions from a database and it can be any number of questions.
I do not know a good way to generate all the required text boxes dynamically, because, I have an aspx file, which just has the page skeleton (header and all) but the remaining content has to be set by the cs file for the form. I have found a way of doing this, but am not sure if (I don't think this is) this is the right way - in my cs file, I create the entire html form using StringBuilder and then set the innerHTML of a div in my aspx. I don't even know if this will work whent he user completes the test and submits it (haven't gotten that far yet) - i.e. I do not know if I'd be able to retrieve the values from text boxes, which are named like txtAnsToQues1, txtAnsToQues2, etc.
Any help or a right direction is appreciated.
(I did search the forum first and came up with some dynamic form results, but none answered what I am looking for - perhaps this is too basic?)
Thanks,
~R
|
|
|
|
|
The easiest way to approach this would be to use a data-bound control like a ListView to display the questions and corresponding input controls. Within the ItemTemplate for your data-bound control, you can declare an instance of each type of input control you want to use (TextBox, CheckBox etc.) Then at run-time, override the ItemDataBound event for your control and show/hide each input control for the current question being rendered as appropriate. On postback, to save the user's input, loop through the Items collection for the control, use FindControl to locate the correct control containing the user's input, then save the information to your database (or whatever)
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Paul,
Appreciate your response - it reinforces the fact that I am a newbie (but I'll get there) . I am going to read in detail on the ListView to see how and if I can use it in my case. I need to present a beautiful looking form, with (dynamic number of) categories, each having (dynamic number of) questions and each question needs to have an appropriate (let's say its only text box for now) control against it. And yes, on postback, I need to go through each answer and save it in a DB. The form needs to look beautiful and organized in catgories with a layout something like
-------------
Category One |
-------------
--> Question 1. In context of gravitational force, what is the difference between 'g' and 'G'?
Answer 1. [Text Box]
--> Question 2. What is the formula for the gravitational pull between two bodies of mass M1 & M2 that are x distance apart?
--> Answer 2. [Text Box]
-------------
Category Two |
-------------
--> Question 1. In context of gravitational force, what is the difference between 'g' and 'G'?
Answer 1. [Text Box]
--> Question 2. What is the formula for the gravitational pull between two bodies of mass M1 & M2 that are x distance apart?
--> Answer 2. [Text Box]
Will the ListView allow for the tables (that's how I am grouping categories and ques within), images, etc?
Thanks,
|
|
|
|
|
To display a list of questions grouped by category you would need 2 ListView controls, one nested inside the ItemTemplate of the other.
Have a look at this[^] open-source ASP.NET Questionnaire application. I've used it in the past as a building-block for creating a survey website.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I was unable to download the sample from the link you pointed me to, but I read a little about ListView control at another website and so far it looks promising. In the sample I read, they had used and asp:AccessDataSource in the aspx file itself and simply pointed to the mdb file with a SELECT query. In my case, I need to select categories from table 1, loop over categories and select questions for each. Not sure how to do this...
Paul - please know, your help and time are much appreciated
Many thanks,
~R
|
|
|
|
|
Bind your parent ListView control that is displaying the categories to a SELECT query that fetches these categories.
Handle the ItemDataBound[^] event for your parent ListView control. This will fire each time data for an individual category is bound to the list control.
The following code demonstrates how to handle this event and use LINQ to get all orders for the child list control associated with a customer from the parent list control. It uses data from the Northwind database. The parent list control is bound to a SqlDataSource control.
protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
string customerID = ((System.Data.DataRowView)((ListViewDataItem)e.Item).DataItem)["CustomerID"].ToString();
ListView listView2 = e.Item.FindControl("ListView2") as ListView;
using (NorthwindModel.NorthwindEntities context = new NorthwindModel.NorthwindEntities())
{
var orders = (from o in context.Orders
where o.Customers.CustomerID == customerID
select o).ToList();
listView2.DataSource = orders;
listView2.DataBind();
}
}
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Paul,
Cannot thank you enough... but Thanks!
~R
|
|
|
|