J
JohnE
Have the following for inserting a person's name. If the user was to select
the empty space of the droplist, it will error. I was wondering if an else
or the full try...catch would be needed here? If an else is sufficient, what
is the better approach in what to use.
protected void lvwDetailDeveloperEditInsert_ItemInserting(object sender,
ListViewInsertEventArgs e)
{
DropDownList ddlDeveloperIDInsertEdit =
(DropDownList)e.Item.FindControl("ddlDeveloperIDInsertEdit");
Label ChangeRequestIDLabel =
(Label)e.Item.FindControl("ddlSelectChangeRequest");
if (ddlDeveloperIDInsertEdit != null)
{
e.Values["DeveloperID"] =
(Convert.ToInt32(ddlDeveloperIDInsertEdit.SelectedValue));
e.Values["ChangeRequestID"] =
(Convert.ToInt32(ddlSelectChangeRequest.SelectedValue));
}
}
Thanks...John
the empty space of the droplist, it will error. I was wondering if an else
or the full try...catch would be needed here? If an else is sufficient, what
is the better approach in what to use.
protected void lvwDetailDeveloperEditInsert_ItemInserting(object sender,
ListViewInsertEventArgs e)
{
DropDownList ddlDeveloperIDInsertEdit =
(DropDownList)e.Item.FindControl("ddlDeveloperIDInsertEdit");
Label ChangeRequestIDLabel =
(Label)e.Item.FindControl("ddlSelectChangeRequest");
if (ddlDeveloperIDInsertEdit != null)
{
e.Values["DeveloperID"] =
(Convert.ToInt32(ddlDeveloperIDInsertEdit.SelectedValue));
e.Values["ChangeRequestID"] =
(Convert.ToInt32(ddlSelectChangeRequest.SelectedValue));
}
}
Thanks...John