|
hi frndz,
i wanna ask can i change text property of a label of some other webform(.aspx) in current webform(.aspx)
with thanks
Tarun Suneja
|
|
|
|
|
You should only be displaying one webform(.aspx) at a time.
You can pass values from one to another via querystring or storing in session.
Then set the value of the next page on page load.
Don't forget
if (!ispostback)
{
}
I didn't get any requirements for the signature
|
|
|
|
|
If you don't want to use a postback you can try using javascript. Something like ...
window.parent.document.getElementById("X")
|
|
|
|
|
I'm trying to validate a date, however, somehow the same code is not working within one project whilst it is working on the "test" project.
I've also noted that although the OS regional options format is set to dd/mm/yyyy, the format returned by another control (in my case a grid view), is in the following format: 3/31/2009 12:00:00 AM. Is it possible that .NET has its own "default setting"? Information would be appreciated.
I also tried checking the other methods accepted by DateTime.Parse. It would be appreciated if you could guide me as to what they usually mean.
Specifically what options should I fill in for IFormatProvider (a dummy value?) and System.Globalization.DateTimeStyles.
I've skimmed the web high and low so far and haven't found any specific info so far.
Any idea why?
DateTime _dateToValidate;
if (DateTime.TryParse(txtIdealDeliveryDate.Text, out _dateToValidate) != true)
{
Response.Write("Invalid date format for Ideal Delivery Date. Please leave empty or update date in [dd/mm/yyyy] format");
ButtonMode = multifunctionButtonFunction.NoUpdate;
}
.NET Framework 2.0
Related links:
http://msdn.microsoft.com/en-us/library/97x6twsz(VS.80).aspx[^]
Jon
|
|
|
|
|
If I understood you correctly, you want to validate the date and allow only dd/mm/yyyy format. Correct? If yes, following code will do it
string dateString = "3/31/2009 12:00:00 AM";
string dateFormat = "dd/M/yyyy h:mm:ss tt";
DateTime dateTime;
if (!DateTime.TryParseExact(dateString,dateFormat,
CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
else
I am on linux now and I haven't tested the above code. But looks like it will do the job.
|
|
|
|
|
Also it easy to use an asp.net validator control.
<code>
<asp:comparevalidator id="TargetDateValidator" runat="server" type="Date" operator="DataTypeCheck" display="dynamic"
ValidationGroup="Default" ErrorMessage="The target date is not valid format = "mm/dd/yyyy" ControlToValidate="TargetDateTextBox"></asp:comparevalidator>
</code>
I didn't get any requirements for the signature
|
|
|
|
|
hi frndz,
i am working with a project and stuck sumwhere. i need sum help regarding that.
actually i have some items in one dropdownlist of a webform(.aspx page). i want the selected value to be transferred to a textbox in other webform(second .aspx page).
i'll be thankful to u if u can help me......
with thanks...
Tarun Suneja
|
|
|
|
|
You need to read about Session in ASP.Net, you can find some nice atricles on CodeProject.
anyways quick answer is:
On the First Page. at "DropDownList" : "SelectedIndexChanged" event.
store the value in the Session.
i.e.
Session["_Value"] = DropDownList1.Text
And on Second Page. at Page Load event.
get the value stored in the session.
i.e.
TextBox1.Text = (string) Session["_Value"];
|
|
|
|
|
|
Pass it as query string if the information is not secured.
|
|
|
|
|
Try this :
Respose.Redirect("~/second.aspx page?selectedValue=" + DropDownList1.SelectedValue.ToString()
|
|
|
|
|
I'm using a gridview in order to display some information from a database, and, I would like to make it obvious to the user which row they have selected.
Control: System.Web.UI.WebControls.GridView
I have set:
SelectedRowStyle > BorderColor to Black
SelectedRowStyle > BorderStyle to Dotted
Do I need to set anything else?
Jon
|
|
|
|
|
I think you've got it.
If you're just starting with data access, you may find this series of tutorials useful: http://www.asp.net/learn/data-access/[^]
Helped me no end when I started.
Frauke Nonnenmacher
Creative Cats
|
|
|
|
|
|
I asked because somehow the link color still hasn't changed on IE7, when the "user" selects the row from the gridview.
Jon
|
|
|
|
|
Hi
I am using AccessdataSource with a formView and I have an Auto number column called PID how can i get the PID value of the inserted redord I am using VB.Net please help thanks.
Mohammad Al Hoss
Development To Me Is A Pleasure more than a Job
|
|
|
|
|
Mohammad Al Hoss wrote: please help thanks.
Sure why not, here you go[^]
|
|
|
|
|
ASALAMOALEKUM ALL,
I am using fileupload control in my website to allow user to uplaod a display picture for its profile page.
The problem is fileupload1.filename takes only filename not the whole path and while using the following
fs = new FileStream(@imagename, FileMode.Open, FileAccess.Read);
FileAccess.Read is throwing exception that the requested file is not on the root path i.e;
for eg: if user browse an image to be uploaded from path E:\IMAGES\pic001.jpg
string imagename = fileupload1.filename ....
(it results:- imagename=pic001.jpg)
now at point FileAccess.Read it throws exception that :
"Could not found C:\MyDocuments\Project\pic001.jpeg"
where: C:\MyDocuments\Project is the root path for my project.
PLEASE tell me how to solve thisss so i could upload image file from any path from the system??
Thanks,
Regards,
SANA
$@N@
|
|
|
|
|
well how about that, using your exact thread title in google[^] gives a bunch of really useful pages right at the start of the search results.
How about you read the documentation for the file upload control, and if its still not clear feel free to post back
|
|
|
|
|
|
I think you are going about this in the wrong fashion - the upload control has a property called PostedFile that will contain the data that has been uploaded - you need to access this.
Your code above is running on your server, so has no way of accessing the client's machine...
There are a number of good articles out there about doing this.
|
|
|
|
|
|
Try in html page. It has a property called value where u get the path of the image.
|
|
|
|
|
Hey, guys.
Using Sql Server stored procs is pretty painless in general, but I'm having a little trouble with a GridView scenario (VS 2008).
I can point the data source .SelectCommand to the name of the stored proc, and I can create and add parameters. However, for the particular type of param that's used in this case (as opposed to the general SqlCommand scenario), I'm not getting the expected results when assigning the value to that param at runtime. There's overloads of the routine to add params that takes the param id, type and value, but at runtime I don't get any data back from the call.
Using a "Select * from yada yada" in the SelectCommand works fine, and when I run the stored proc from Sql Server with the value I'm passing in, I get the expected data as well. Just not when using a proc name in the SelectCommand and add param approach with the data source and grid view.
Been googling quite a bit and can't seem to find any examples for this. Anyone know of a working code snippet they could point me to?
Thanks,
|
|
|
|
|
I don't think your problem has anything to do with the grid view.
I'm guessing you simply forgot to set the commmandType of the SQLCommand to StoredProdcedure.
I didn't get any requirements for the signature
|
|
|
|