|
yeah thats right but my mean is the format of inside paranteses.
Convert.ToDateTime(?????);
|
|
|
|
|
is what you place between () a value in C# or an SQL Value?
Convert.ToDateTime(object) sees your c#value as an object and converts it to a datetime object.
The datetime object will be stored in your database.
Do you use Stored Procedures and SqlParamaters?
You can define an SqlParameter as SqlDbType.DateTime. Then you do not need to worry about date formats.
The direction is from c# value to a database or the other way ?
If you want to style a DateFormat in C# to dd-MM-yyyy you can do
DateTime myDateTime = DateTime.Now;
String StyleMyDateTime = Strong.Format("{0:dd-MM-yyyy}", myDateTime);
could you provide some more details of your problem like some code u use?
|
|
|
|
|
Hi,
I am using datalist control. In that One label is there and One button is also there. I want to bind label value to button.
While in Display there are 4 buttons generated and 4 labels. For labels I bind id. Now When I click button1 I want to fetch Label1 (id of that label)
This is on the Button click event
foreach (DataListItem item in dgBindImage.Items)
{
Label lbl_chk = (Label)item.FindControl("Label1");
Response.Redirect("UpdateProduct.aspx?");
}
It gives me same id from label. But while displaying label it shows differently.
I want different id when the button is selected.
Thanks
|
|
|
|
|
unable to understand what the crap it is?
why u r using response.redirect in a loop ?
state clearly your motive....
you can even assign the value for datakeyfield.....that is the property to be used for such cases....
Ashish Sehajpal
|
|
|
|
|
i have to create a web application for sending the bulk sms...i did googling but not found the proper guidance...that what to do..please let me know what are the proper steps i have to follow...n what is the code...can i send the sms free using some web-services etc...please tell me what are the steps and code for sms......
|
|
|
|
|
Neetu Maheshwari wrote: i have to create a web application for sending the bulk sms...
Gee - that doesn't sound evil at all...
There is no generic code, you need to google for an sms provider in the area, or probably, in the area of your client, who is probably not in the same country as you.
I can't imagine a reason to hope you succeed. Don't we get enough spam ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
oh i mean to say sending sms to all my client at a time...not that type of bulk...sorry for using wrong word...
|
|
|
|
|
Check out http://www.smscountry.com/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
It depends on the country you want to do this in, there is a back door to the sms systems but most if not all US countries have shut it down.. oh in case anyone wonders why i know that i work for a mass communications firm that does emergency notifications for schools, and some schools and universities wanted sms capability since it travels on a side band to the normal cell traffic, it wouldn’t need an open line like a voice call would..and they seem to have a longer range than what you can get with a voice call. The only way to currently use a providers sms service is to either slave a bunch of phones from x provider to a pc and send them that way or contact an aggregator or become one yourself, but it is a very long(years) process to become a sms aggregator for most companies here. along with signing a large number of very large legal documents saying you aren’t going to spam anyone, and that you are directly (legally and financially) liable if you do. you'd have a better time finding a company that already does it and use their service.
|
|
|
|
|
How to add data in two columns in a grid view and display that in a third column.Please help me out in this matter
|
|
|
|
|
The obvious way is to do it in your data layer
select x, y, x+y as z from myTable
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
if u do not have access to data layer, u can better do it in rowdatabound event.. read value from cells at specific index and add it up to assign it to label present in third column(obviously template column)....
Ashish Sehajpal
|
|
|
|
|
Hi all,
I'h a ajax control ModalPopupExtenderModal in my site, and it's have targetcontrolID to an imagebutton so far so good, and the popUpcontrolID is directed to an panel and thats ok too, but when I click on the imageButton and get the larger image to view, it's ok but I want to click the large image and be redirected back to the page where i came from....
Do somebody have any tips, how I can do that?...
/max
|
|
|
|
|
As I understand it, you want the popup to disappear when the user clicks something in the popup. I think the functionality the cancel button has implemented in this example[^] is what you need. You can download the samples and view the source on how they did it.
Broken Bokken
http://www.brokenbokken.com
|
|
|
|
|
perfect, I solved it...thanx...
/max
|
|
|
|
|
plzz tell me when we write atlas:scriptmanager and when asp:scriptmanager.
tbhattacharjee
|
|
|
|
|
I believe atlas is the old name for it, as in prerelease.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You are right. If you have old code, chances are that your library has a mapping in the web.config for the library to the prefix atlas.
It might look something like this
<pages>
<controls>
<add tagprefix="atlas" namespace="System.Web.UI" assembly="System.Web.Extensions" />
</controls>
</pages>
You may want to double check that you have the latest version of the ajax and the control toolkit downloaded.
Broken Bokken
http://www.brokenbokken.com
|
|
|
|
|
thanks for your answer .
tbhattacharjee
|
|
|
|
|
Hi,
I am displaying image in the datalist. But if image is blank then in IE it will display blank image but in FireFox it is displaying Submit Query.
How Can I remove Submit Query. I am using image button.
Any other Solution for that.
Thanks
|
|
|
|
|
have you mentioned alternateText there?
a better approach is to use a blank image as default image i.e. an image with some text like "No Image" written in it to be used in cse user has not uploaded any image...
Ashish Sehajpal
modified on Tuesday, April 15, 2008 10:17 AM
|
|
|
|
|
I have a problem how I get the user controls parameter from codebehind (when I make a dynamic instans of this) on the page.
My user control ascx file:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="TestSetProject.ascx.cs" Inherits="UserControls_TestSetProject" %>
<center><h3><asp:Label ID="lblEditProjectHeadline" runat="server" Text="Projektdetaljer for"></asp:Label>
<asp:Label ID="lblEditProjectNameHeadline" runat="server" Text=""></asp:Label></h3></center><br />
My user control ascx.cs file:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class UserControls_TestSetProject : System.Web.UI.UserControl
{
private string _ProjectId = "";
public string ProjectId
{
get { return _ProjectId; }
set { _ProjectId = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
lblEditProjectNameHeadline.Text = ProjectId;
}
}
My test aspx page:
<%@ Page Language="C#" MasterPageFile="~/MPHead.master" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Content_Test" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="lblNewProjectEditProjectId" runat="server" Text="" Visible="false"></asp:Label><br /><br />
<asp:Button ID="btnPush" runat="server" Text="Push me" OnClick="btnPush_Click" />
<asp:PlaceHolder ID="phNewProjectEdit" runat="server"></asp:PlaceHolder>
</asp:Content>
My test aspx.cs file:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class Content_Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Control setproject = LoadControl("~/UserControls/TestSetProject.ascx");
phNewProjectEdit.Controls.Add(setproject);
}
protected void btnPush_Click(object sender, EventArgs e)
{
lblNewProjectEditProjectId.Text = "15855";
}
}
What I need, is that the user control will be instansiated (created) when I click on the btnpush button on the page og then takes what I have wrote in the lblNewProjectEditProjectId.Text into the user control (where I then can use it).
Can anybody please help me on this?
Kind regards,
simsen
|
|
|
|
|
simsen wrote: private string _ProjectId = ""; public string ProjectId { get { return _ProjectId; } set { _ProjectId = value; } } protected void Page_Load(object sender, EventArgs e) { lblEditProjectNameHeadline.Text = ProjectId; }
Replace all of this with:
public string ProjectId
{
get { return _lblNewProjectEditProjectId.Text; }
set { _lblNewProjectEditProjectId.Text = value; }
}
your issue right now is that page load occurs before any events, and you will have trouble setting the property so it gets used. Even if you move it to prerender, just setting it directly seems more sensible to me.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Christian,
Thanks for your reply,
I tried to use your code indstead.....But I then get a problem when running the code... It sais that the _lblNewProjectEditProjectId doesn't exist.
What do I miss?
The _lblNewProjectEditProjectId is on the aspx page and not on the ascx page where I have to use it. And I have to use the ProjectId (I get from the aspx) on the ascx page. I don't know the labels id each time I have to use the control (the control will be used on different pages).
Kind regards,
simsen
|
|
|
|
|
simsen wrote: The _lblNewProjectEditProjectId is on the aspx page and not on the ascx page where I have to use it
OK, then I dunno how it ever compiled. What does the user control do, if the property you want to set is on the aspx ? Why does the user control matter then ?
If you want to set a property on the control and have it change a control on the main page, that seems strange to me, but you could use a delegate to pass the value through. It's sloppy tho, if the control is on the aspx. set it there.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|