|
I don't know if this would help.
I read somewhere that the FROM field can not be a variable and must be set to an existing email address in the server.
Try using your email address in the from (the one registered in the server you use to send the email). Also find out if your server needs to validate user and password.
If it does you might need to supply them.
And if this works and you need to register the sender's email just add it to the sender message.
Hugo
Hugies.....
|
|
|
|
|
Hey there,
i have a gridview inside my repeater.
Why cant i directly access it from my code?
what do i need to do, and what have i overlooked?
Christian
cbm.dk
|
|
|
|
|
try this:
<br />
GridView gv = (GridView)dataRepeaterId.Items[X].FindControl("gridViewId");<br />
where dataRepeaterId and gridViewId correspond with how you have them labeled in the markup and X is the index of the item you wish to get the gridview out of.
The problem is your gridview is inside another control so you have to pull it out.
|
|
|
|
|
Hi all,
I am using GridView in one ASP.NET, VB.NET application. I want to select data using select command of SqlDataSource but I don't want to do other operations like deleting and updating using SqlDataSource. So I am using RowDeleting() and RowUpdating() event handler of GridView. But When I click on Delete link in GridView it goes to event handler, do delete operation using my custom query and then it gives me error like "Deleting is not supported by data source (SqlDataSource1) unless DeleteCommand is specified". Any way to get rid out of this DeleteCommand?
Thanks in advance,
Priyank
|
|
|
|
|
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
e.Cancel = True
End Sub
I hope it should work.
http://www.tsspltd.com
|
|
|
|
|
Hi,
When manually binding an SqlDataSource, sorting and paging does not work on the GridView. Is there some kind of settings or code to make the sorting and paging work?
SqlDataSource1.SelectCommand() = sSQL
GridView1.DataSource = SqlDataSource1
GridView1.DataBind()
Note that when the SqlDataSource1 and the GridView is bind at design, the sort and paging work fine.
Thank you.
|
|
|
|
|
My problem is that I can't put the html that is rendered by my .aspx file into a pdf file using itextsharp.
the aspx file does not contain any pictures.
BiG RaLpH
|
|
|
|
|
i have a document library (named: Outstandings) which contain word cosuments, i searched a document (named: Balance_343,35725.doc) within this library , i ahve some columns in this library, i want to change the value of column/filed(named: Document Library) , how can i change the value of field? (actually i want to show a library name as link in the clumns in front of document)
This is my code:
SPSite sitecollectiont = SPControl.GetContextSite(Context);
SPWeb sitet = sitecollectiont.OpenWeb();
sitet.AllowUnsafeUpdates = true;
SPListCollection lists = sitet.Lists;
foreach (SPList list in lists)
{
if (list.Title == "Outstandings") //this D. library
{
SPListItemCollection items = list.Items;
foreach (SPListItem item in items)
{
SPFile file = item.File;
string docName = file.Name;
if (docName.Equals("Balance_343,35725.doc"))
{
SPField field = item.Fields.GetField("Document Library"); //this is column name
field.DefaultValue = "1234";
field.Update(true);
return;
}
}
}
but setting its value by defaultValue necver worked.
Please help to set the value as a link to Library.
Thanks
Needo
|
|
|
|
|
hi
i'd like to know how can i only get date part of a variable not the time part
for example i have a variable that its value is "1/1/2000 12:00AM" and i only want "1/1/2000"
thank you
|
|
|
|
|
myDate.ToShortDateString()
|
|
|
|
|
how can i specify certain file formats to be browsed by file upload control?
for example i just like my file upload control to browse JPG and GIF files
thank you
|
|
|
|
|
I tried this but there no way that you can show a specific type of files howerver after browsing you can check the extension and prompt the appropriate message.
Shujaat
|
|
|
|
|
I am using a Gridview which is getting it's data from a Stored procedure. The values passing to the stored procedure are coming from a QueryString.
When I run the GridView configuration the correct data is returned when I test the connection but when I run it, the gridview page just comes back blank and displays nothing.
Anyone any ideas?
macca
|
|
|
|
|
It sounds as though you are missing a call to the DataBind() method of the gridview after settings its DataSource .
|
|
|
|
|
Thanks for the reply Brent but:
How and where can I set this?
macca
|
|
|
|
|
Hmm you must be using the visual interface to to get your data rather than coding your own data access layer. In that case I won't be able to help much ( I prefer to code my own DAL) other than to say it sounds as though your gridview is not bound to the data source correctly.
|
|
|
|
|
Brent, Got this sorted. I coded instead.
Thanks,
macca
|
|
|
|
|
when a network is said to be intranet and when it said to be internet and when it said to be extranet? And anybody knows about the technical issues to make the network intranet,please share with me
Thank you
|
|
|
|
|
Typing that into Google would have been faster!
But because you made me curious: http://www.hcidata.info/inet.htm
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
The internet is just the entire net, without any limitations or specific purpose. An intranet is used to share information in a local network. An extranet is basically an intranet that you can access from outside the local network. Usually the only difference is which people you give a login to, i.e. an intranet can physically be an extranet because you can reach it from anywhere, but it's only used by people inside the company.
Wikipedia: intranet[^]
Wikipedia: extranet[^]
---
single minded; short sighted; long gone;
|
|
|
|
|
I have a question regarding Asynchronous Requests.
Is there some way the requests can be made to operate at the same time?
i have one button on the page. everytime user clicks the button a call to database is made Asynchronously and the results are shown in the grid on completion. For every database result there is a new row in the grid. The problem is, every asynchronous call executes after the previous one is completed showing a behaviour of queues. However i need pure asynchronous tasks that is the results of less time consuming should appear first even if it was started at later. for more clarity here is code for both aspx and aspx.cs. before executing this code please make sure the connection string is ok for your machine. on execution click the button immidiately more than one times and see the start and end times.
Looking forward to your reply. Thanks in advance.
Regards,
Ishfaq Hussain
-----------------------------Sample.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Sample.aspx.cs" Inherits="_sample" %>
DisplayAfter="0">
DisplayAfter="0">
Updating panel3
DisplayAfter="0">
Updating panel2
Sys.Application.add_load(ApplicationLoadHandler)
function ApplicationLoadHandler(sender, args)
{
var prm = Sys.WebForms.PageRequestManager.getInstance();if (!prm.get_isInAsyncPostBack())
{
prm.add_initializeRequest (InitializeRequest);
prm.add_endRequest(CompleteRequest);
}
}
// initialize a queue
var myQueue = new Array();
function CompleteRequest(sender, args)
{
if(myQueue.length > 0)
{// fire correspond event again of the item cached
$get(myQueue[0].id).click();
Array.removeAt(myQueue, 0);
}
}
function InitializeRequest(sender, args)
{
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm.get_isInAsyncPostBack())
{// if it's working on another request, cache the current item that cause the request
args.set_cancel(true);
Array.add (myQueue, args.get_postBackElement());
}
}
if(typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
-----------------------------Sample.aspx.cs
using System;
using System.Data;
using System.Data.SqlClient;
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 _sample : System.Web.UI.Page
{
DataTable dt = new DataTable();
private SqlConnection conn;
private SqlCommand command;
private SqlDataReader _reader;
private int ThreadCount=0;protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
dt.Columns.Add("Task ID");
dt.Columns.Add("Order ID");
dt.Columns.Add ("Start Time");
dt.Columns.Add("End Time");
dt.Columns.Add ("Order Amount");
ViewState["dt"] = dt;Session["ThreadCount"] = ThreadCount;
}
dt = (DataTable)ViewState["dt"];
ThreadCount =(int) Session["ThreadCount"];
}
protected void Button1_Click(object sender, EventArgs e)
{
ThreadCount++;
Session["ThreadCount"] = ThreadCount;
//Response.Write( Request.QueryString["values"]);
//Response.Write("
Request No" + ThreadCount.ToString() + "
");
Label1.Text = ThreadCount.ToString();
Random rand = new Random();
int n = rand.Next(10000, 11077);
//Guid taskId = Guid.NewGuid();
int taskId = ThreadCount;
string stime = System.DateTime.Now.TimeOfDay.ToString();
Tasks task = new Tasks();
//task.guid = taskId;
task.TaskID = taskId;
task.OrderID = n.ToString();
task.StartTime = stime;
//AddListViewItem(task.guid, int.Parse(task.OrderID), task.StartTime);
AddListViewItem(task.TaskID, int.Parse( task.OrderID), task.StartTime)ageAsyncTask asynctask = new PageAsyncTask(BeginAsyncOperation, EndAsyncOperation, EndTimeOutInvoke, task);
RegisterAsyncTask(asynctask);
}
IAsyncResult BeginAsyncOperation(object sender, EventArgs e, AsyncCallback cb, object state)
{
Tasks task = (Tasks)state;
conn = new SqlConnection("Data Source=localhost;Initial Catalog=Northwind; Integrated Security=true; Asynchronous Processing=true");
command = new SqlCommand();
command.CommandText = "WAITFOR DELAY '0 " + new Random().Next(1, 9) + "' SELECT isnull(sum((UnitPrice * Quantity)-Discount),0) from [Order Details] WHERE OrderID = " + int.Parse (task.OrderID);
//command.CommandText = "SELECT isnull(sum((UnitPrice * Quantity)-Discount),0) from [Order Details] WHERE OrderID = " + n;
command.Connection = conn;
conn.Open();
//SqlDataReader dr = command.ExecuteReader();
//etime = System.DateTime.Now.TimeOfDay.ToString();
//DataTable dt = new DataTable();
//dt.Load(dr);
return command.BeginExecuteReader(cb, task);
}
void EndAsyncOperation(IAsyncResult ar)
{
_reader = command.EndExecuteReader(ar);
string etime = System.DateTime.Now.TimeOfDay.ToString();DataTable tempdt = new DataTable();
tempdt.Load(_reader);
UpdateListViewItem((Tasks)ar.AsyncState, float.Parse(tempdt.Rows[0][0].ToString()), etime);
}
public void EndTimeOutInvoke(IAsyncResult result)
{
//if (cnx != null && cnx.State != ConnectionState.Closed)
// cnx.Close();
Response.Write("TimeOut");
Response.End();
}
protected void Page_PreRenderComplete(object sender, EventArgs e)
{
//gridTasks.DataSource = dt;
//gridTasks.DataBind();
}
private void AddListViewItem(
//Guid guid,
int taskID,
int testNumber,
string sTime)
{
DataRow drow = dt.NewRow();
//drow["Task ID"] = guid.ToString();
drow["Task ID"] = taskID.ToString();
drow["Order ID"] = testNumber.ToString();
drow["Start Time"] = sTime;
drow["End Time"] = "---";
drow["Order Amount"] = "---";
dt.Rows.Add(drow);
gridTasks.DataSource = dt;
gridTasks.DataBind();
}
private void UpdateListViewItem(
Tasks task,
float Amount,string eTime
)
{
try
{
int i = 0;foreach (DataRow drow in dt.Rows)
{
//if ((Guid)lvi.Tag == guid)
//Guid g = new Guid(drow["Task ID"].ToString());
int tid = int.Parse(drow["Task ID"].ToString());if (tid == task.TaskID)
{
//drow["End Time"] = eTime;
//drow["Order Amount"] = Amount.ToString();
dt.Rows[i]["End Time"] = eTime;dt.Rows[i]["Order Amount"] = Amount.ToString ();
dt.AcceptChanges();
break;
}
i++;
}
gridTasks.DataSource = dt;
gridTasks.DataBind();
}
catch (Exception ex)
{
}
}
protected void Button2_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);Label2.Text = DateTime.Now.ToLongTimeString();
}
protected void Button3_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(2000);
Label3.Text = DateTime.Now.ToLongTimeString();
}
}
------- Tasks.cs---------------------
using
System;
using
System.Data;
using
System.Configuration;
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;
///
///
Summary description for Tasks
///
public
class Tasks
{
//private Guid _guid;
private int _taskID;
private string _orderID;
private string _startTime;
private string _endTime;
private float _amount;
//public Guid guid
//{
// get
// {
// return _guid;
// }
// set
// {
// _guid = value;
// }
//}
public int TaskID
{
get
{
return _taskID;
}
set
{
_taskID =
value;
}
}
public string OrderID
{
get
{
return _orderID;
}
set
{
_orderID =
value;
}
}
public string StartTime
{
get
{
return _startTime;
}
set
{
_startTime =
value;
}
}
public string EndTime
{
get
{
return _endTime;
}
set
{
_endTime =
value;
}
}
public float Amount
{
get
{
return _amount;
}
set
{
_amount =
value;
}
}
}
Ishfaq Hussain
|
|
|
|
|
Hi All
the Problem I am facing is that I am using RadioButtonList which is created Dynamically.
All I have to do is to trap the events of this RadioButtonList using JavaScript. and create 2 other controls on change selection of this RadioButtonList.
to add further to this is that I do not know the ClientID for items in RadioButtonList at the point of compilation.
Dream'Z Unlimited
|
|
|
|
|
No probs you need to register the javascript from server side so one thing pass the clientid of the radiobutton list from server i.g
<br />
RadioButton objects = new RadioButton();<br />
objects.ID = "Somthing";<br />
objects.Text = "Click me";<br />
this.Page.Form.Controls.Add(objects);<br />
<br />
objects.Attributes.Add("OnClick", "javascript:alert('"+objects.ClientID+"');");<br />
<br />
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi
im using visual studio 2005 which has default crystal reports ,but when i add a new crystal report file, i am unable to insert chart's, since the chart is disabled from my menu in visual studio 2005, how to enable this chart option in visual studio 2005
regards
winnie
|
|
|
|
|
i wanted to ask the example (a real life example) that pertains to the passport authentication.
According to my understanding it should be MSN Messenger
Is it right?
Soniagupta1@yahoo.co.in
|
|
|
|