|
Simple and nice way wold be to use AJAX Update Panel.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
why are u using count in stead of i ?
and why you choose count to be a static?
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
I have a small asp.net developed web application. I need to run it outside Visual Studio IDE as stand alone. Let me know if there is a way to do?
|
|
|
|
|
like this[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi All,
I have a asp.net website. There are two area one is front-end and another is admin area. I use google
analytic in front-end pages and I need show google analytic report in my admin area as web statistic.
My question is that how can I show the google analytic report in my admin section. What is the script,
how to use this.
I check google forum, but could not understand.
please help.....
Thanks
Rajesh
|
|
|
|
|
Hello everyone.
I try to build graph with this link
http://chart.apis.google.com/chart?chs=800x300&cht=lxy&chxt=x,y&chxl=1:|0%|10%|20%|30%|40%|50%|60%|70%|80%|90%|100%|0:|0||||||||||||||||||||||||||||||||||||||||40||||||||||||||||||||||||||||||||||||||||80||||||||||||||||||||||||||||||||||||||||120||||||||||||||||||||||||||||||||||||||||160|&chg=10,10&chd=t:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160%20|5.46666666666667,4,2.16666666666667,3.06666666666667,2.36666666666667,7.6,8.13333333333333,15.0333333333333,16,18.1666666666667,7.46666666666667,5.8,3.6,8.46666666666667,5.56666666666667,18.1,5.3,4.5,8.63333333333333,10.5333333333333,15.6,12.5333333333333,1.46666666666667,1.63333333333333,2.1,9.03333333333333,2.73333333333333,8.96666666666667,11.1,12.9,9.5,10.4666666666667,11.4,4.36666666666667,10.7666666666667,5.7,14.1333333333333,7.5,5.16666666666667,11.5666666666667,16.4,11.7,10.1333333333333,3.1,4,2.5,9.66666666666667,15.7333333333333,11.2666666666667,6.06666666666667,10.1333333333333,6.3,36.0666666666667,11.6,8.56666666666667,5.6,2.66666666666667,5.4,2.43333333333333,11.3333333333333,7.96666666666667,12.0333333333333,5.4,5.76666666666667,4.1,4.46666666666667,6.56666666666667,13.1666666666667,16.4,2.2,11.2333333333333,4.56666666666667,7.96666666666667,15.6333333333333,10.7666666666667,12.5,4,4.26666666666667,3.66666666666667,10.2,7.76666666666667,12.1,5.63333333333333,10.5666666666667,18.9666666666667,23.2,8.96666666666667,4.3,4.2,7.86666666666667,2.8,3.13333333333333,3.5,4.26666666666667,5.66666666666667,9.03333333333333,8.76666666666667,5.43333333333333,5.63333333333333,10.7,7.86666666666667,6.66666666666667,4.33333333333333,9.36666666666667,4.2,5.96666666666667,5.4,4.03333333333333,9.06666666666667,5.63333333333333,12.5,2.93333333333333,7.2,3.7,2.43333333333333,4.1,1.3,1.13333333333333,1.63333333333333,0.933333333333333,1.03333333333333,1.36666666666667,1.03333333333333,6.1,6.23333333333333,0.766666666666667,0.333333333333333,1.03333333333333,0.766666666666667,4.33333333333333,13.0666666666667,6.53333333333333,2.46666666666667,3.4,2,2.5,1.23333333333333,7.5,1.63333333333333,1.56666666666667,4.86666666666667,0.7,3.1,6,1.16666666666667,6,12.0333333333333,5.16666666666667,8.33333333333333,4.2,4.5,1,9.1,8.2,4.6,5.53333333333333,3.5,3.33333333333333,1.56666666666667,14.6
And got next error
The requested URL /chart... is too large to process.
How can i make link smaller?
Maybe should i use to extended coding of data?
|
|
|
|
|
I just copied/pasted your link in my browser and it rendered with no error messages. All I see is a chart framework, though, with 0 - 160 along the x-axis, and 0 - 100% along the y-axis. There are no data points displayed. You didn't include the chd=t: data,data,data,data... parameter, though, so you didn't pass it any data.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
http://chart.apis.google.com/chart?chs=800x300&cht=lxy&chxt=x,y&chxl=1:|0%|10%|20%|30%|40%|50%|60%|70%|80%|90%|100%|0:|0||||||||||||||||||||||||||||||||||||||||40||||||||||||||||||||||||||||||||||||||||80||||||||||||||||||||||||||||||||||||||||120||||||||||||||||||||||||||||||||||||||||160|&chg=10,10&chd=t:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160|5.46666666666667,4,2.16666666666667,3.06666666666667,2.36666666666667,7.6,8.13333333333333,15.0333333333333,16,18.1666666666667,7.46666666666667,5.8,3.6,8.46666666666667,5.56666666666667,18.1,5.3,4.5,8.63333333333333,10.5333333333333,15.6,12.5333333333333,1.46666666666667,1.63333333333333,2.1,9.03333333333333,2.73333333333333,8.96666666666667,11.1,12.9,9.5,10.4666666666667,11.4,4.36666666666667,10.7666666666667,5.7,14.1333333333333,7.5,5.16666666666667,11.5666666666667,16.4,11.7,10.1333333333333,3.1,4,2.5,9.66666666666667,15.7333333333333,11.2666666666667,6.06666666666667,10.1333333333333,6.3,36.0666666666667,11.6,8.56666666666667,5.6,2.66666666666667,5.4,2.43333333333333,11.3333333333333,7.96666666666667,12.0333333333333,5.4,5.76666666666667,4.1,4.46666666666667,6.56666666666667,13.1666666666667,16.4,2.2,11.2333333333333,4.56666666666667,7.96666666666667,15.6333333333333,10.7666666666667,12.5,4,4.26666666666667,3.66666666666667,10.2,7.76666666666667,12.1,5.63333333333333,10.5666666666667,18.9666666666667,23.2,8.96666666666667,4.3,4.2,7.86666666666667,2.8,3.13333333333333,3.5,4.26666666666667,5.66666666666667,9.03333333333333,8.76666666666667,5.43333333333333,5.63333333333333,10.7,7.86666666666667,6.66666666666667,4.33333333333333,9.36666666666667,4.2,5.96666666666667,5.4,4.03333333333333,9.06666666666667,5.63333333333333,12.5,2.93333333333333,7.2,3.7,2.43333333333333,4.1,1.3,1.13333333333333,1.63333333333333,0.933333333333333,1.03333333333333,1.36666666666667,1.03333333333333,6.1,6.23333333333333,0.766666666666667,0.333333333333333,1.03333333333333,0.766666666666667,4.33333333333333,13.0666666666667,6.53333333333333,2.46666666666667,3.4,2,2.5,1.23333333333333,7.5,1.63333333333333,1.56666666666667,4.86666666666667,0.7,3.1,6,1.16666666666667,6,12.0333333333333,5.16666666666667,8.33333333333333,4.2,4.5,1,9.1,8.2,4.6,5.53333333333333,3.5,3.33333333333333,1.56666666666667,14.6
i have make error in link because i found symbol of space %20
can you try again?
|
|
|
|
|
Good Morning
I have the Following User Control in the Pic "UserControl_Design_Mode.JPG" and i have the Following code to enable Partial Rendering
http://www.vbforums.com/attachment.php?attachmentid=71090&stc=1&d=1242799933[^]
[DefaultValueAttribute(true)]
[CategoryAttribute("Behavior")]
public bool EnablePartialRendering { get; set; }
Am exposing the Properties of a usercontrol like like this
public UpdatePanelUpdateMode UpdateMode
{
get
{
return this.UpdatePanel1.UpdateMode;
}
set
{
this.UpdatePanel1.UpdateMode = value;
}
}
And there are of them
and i went to the Hosting page we have a pic
http://www.vbforums.com/attachment.php?attachmentid=71091&stc=1&d=1242800293[^]
for Example, in the Button Remove i have Finally something like this
Response.Redirect("SubjectStaff.aspx", false);
I was Forcing a Postback and the Whole Page flickers, i want to Refresh only the UserControl.
i tried the Following instead of the above statement
http://www.vbforums.com/attachment.php?attachmentid=71092&stc=1&d=1242800630[^]
Here am trying to call the name of the usercontrol first and then the Properties it exposes, but i only get the load and load1 event , it seems every is hiden now since i have taken the Control inside the Update Paanel in the User Control.
Can you Help me in that Regard
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Create a public method in the user control where bind the controls in the user control with data like below:
public void RefreshThisUC()
{
YourTextBox1.Text = Somevalue;
BindYourDropDownInUserControl();
BindYourGridInUserControl();
}
and call this method in the parent page using the id of the user control like
yourUserControl.RefreshThisUC();
|
|
|
|
|
This is exactly what i did at First, but nothing is happening on the userControll. as you can see the user Control has a gridview, maybe is there a way to refresh the gridview itself the the Refresh method, i tried that , i took the code that binds the Grid and put it in the refresh method, but after i do something on the other side nothing happens
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
How did you call the refresh method in parent page. Have you used that metohd in any page event such us click event of a button in the page where the user control is used?.
|
|
|
|
|
Good morning Ramesh
This is what i did
i made sure that the name is Unique and called it "Refresh_Control" and in the Host page,am refreshing from a Button like this
MyControl.Refresh_Contro();
And nothing Happens
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I just want to confirm that the user control's Refresh_Control() is reached when it called in the button click event. Put a break point in the first line of Refresh_Control method and see whether the grid is bound.
|
|
|
|
|
Yes it get called. More info is that the usercontrol has a Gridview that is binded with a SQldatasource Control
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
So the refresh method in user control is get called in parent page but nothing happens.
Can you post the code in the user control and the parent page including code in Page_load and binding your grid.
Becuase it is working good in my applications.
|
|
|
|
|
Thanks for your Help
and this is the code Behind
for the Usercontrol
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;
using System.Text;
using System.Drawing;
public partial class ActivityCtrl : System.Web.UI.UserControl
{
public static int MinimumActvWidth = 80;
public System.Web.UI.WebControls.Button SaveButton()
{
return btnSaveStructure;
}
public Boolean Enabled
{
set
{
btnSaveStructure.Enabled = value;
gridviewContacts.Enabled = value;
}
}
public int SubjectID
{
set
{
hfmodlID.Value = value.ToString();
LoadSubjectStructure(SubjectID);
}
get
{
if (hfmodlID.Value == "")
{
hfmodlID.Value = "0";
}
return Convert.ToInt32(hfmodlID.Value);
}
}
public string ActivityViewMode
{
set
{
lblViewMode.Text = value;
switch (value)
{
case "Activity": hfViewMode.Value = "0";
break;
case "Streams": hfViewMode.Value = "2";
break;
default: hfViewMode.Value = "1";
break;
}
if (ActivityViewMode == "Activity")
{
menuActivityNameViewMode.Visible = true;
}
else
{
menuActivityNameViewMode.Visible = false;
}
}
get
{
return lblViewMode.Text;
}
}
public string ActivityNameViewMode
{
set
{
menuActivityNameViewMode.SelectedItem.Selected = false;
menuActivityNameViewMode.FindItem(value).Selected = true;
}
get
{
return menuActivityNameViewMode.SelectedValue;
}
}
public Boolean KeepApart
{
set { hfKeepApart.Value = value.ToString(); }
get { return Convert.ToBoolean(hfKeepApart.Value); }
}
public string ActivityBoxViewMode
{
get { return menuActivityNameViewMode.SelectedValue; }
}
public string SelectedContactsXml
{
get
{
string xml = "";
xml = CommonFunctions.ReturnIdsInXmlForGridView(gridviewContacts);
return xml;
}
}
public string SelectedActvs
{
get { return BuildXMLforSelectedActvs(); }
set
{
txtbxActvs.Text = value;
HighlightSelectedActvs();
}
}
public string SubjectTags
{
get
{
return lblSubjTags.Text;
}
set
{
lblSubjTags.Text = value;
}
}
protected void Page_Init(object sender, EventArgs e)
{
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref SqlDataSourceContacts);
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref SqlDataSourceMaxActvs);
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref SqlDataSourceActvDuration);
if (!Page.IsPostBack)
{
if (Session["TTBL_TYPE"].ToString() != "CLASS")
{
gridviewContacts.Columns[1].HeaderText = "Paper Type";
menuActivityNameViewMode.FindItem("Name").Selected = true;
menuActivityNameViewMode.Enabled = false;
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
string clientscript = "";
clientscript = "var txtbxActvClientID = '" + txtbxActvs.ClientID.ToString() + "'; ";
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptBlock(this.GetType(), "txtbxlookupid", clientscript, true);
if (!Page.IsPostBack)
{
}
HighlightSelectedActvs();
}
public void LoadSubjectStructure(int subjectID)
{
SubjectStructure Subj = new SubjectStructure();
Subj = Subj.GetSubjectStructure(subjectID);
lblSubjectDescription.Text = Subj.Descr;
PopulateSubjectTags();
}
public void RefreshUC()
{
string clientscript = "";
clientscript = "var txtbxActvClientID = '" + txtbxActvs.ClientID.ToString() + "'; ";
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptBlock(this.GetType(), "txtbxlookupid", clientscript, true);
if (!Page.IsPostBack)
{
}
HighlightSelectedActvs();
LoadSubjectStructure(SubjectID);
}
public void DisplaySubjectStructure()
{
gridviewContacts.DataBind();
}
public void SetContactRowColors()
{
double hue;
int TypID = 0;
string colorstr = "";
foreach (GridViewRow row in gridviewContacts.Rows)
{
DropDownList drplstCntcTyp = (DropDownList)row.FindControl("drplstCntcTyp");
if (drplstCntcTyp.SelectedValue != null && drplstCntcTyp.SelectedValue != "")
{
TypID = Convert.ToInt32(drplstCntcTyp.SelectedValue);
hue = (TypID - 1) * 50 % 360;
colorstr = CommonFunctions.HSVtoRGB(hue, 0.3, 1.0);
row.BackColor = System.Drawing.ColorTranslator.FromHtml(colorstr);
}
drplstCntcTyp.BackColor = System.Drawing.ColorTranslator.FromHtml(colorstr);
DropDownList drplstDuration = (DropDownList)row.FindControl("drplstDuration");
drplstDuration.BackColor = System.Drawing.ColorTranslator.FromHtml(colorstr);
drplstDuration.BorderColor = System.Drawing.ColorTranslator.FromHtml(colorstr);
}
}
public void HighlightSelectedActvs()
{
string actvstr = "";
int actvID = 0;
bool selected = false;
foreach (GridViewRow row in gridviewContacts.Rows)
{
DataList datalistActvs = (DataList)row.FindControl("datalistActvs");
if (datalistActvs != null)
{
foreach (DataListItem dlitem in datalistActvs.Items)
{
switch (ActivityViewMode)
{
case "Activity":
ActivityBox actvbox = (ActivityBox)dlitem.FindControl("ActivityBox1");
actvID = actvbox.ActvID;
actvstr = "=" + actvID.ToString() + ";";
selected = txtbxActvs.Text.Contains(actvstr);
actvbox.Selected = selected;
break;
case "Streams":
ActvStreams actvstrm = (ActvStreams)dlitem.FindControl("ActvStreams1");
actvID = actvstrm.ActvID;
actvstr = "=" + actvID.ToString() + ";";
selected = txtbxActvs.Text.Contains(actvstr);
actvstrm.Selected = selected;
break;
case "Staff":
ActivityResource actvstaff = (ActivityResource)dlitem.FindControl("ActivityResource1");
actvID = actvstaff.ActvID;
actvstr = "=" + actvID.ToString() + ";";
selected = txtbxActvs.Text.Contains(actvstr);
actvstaff.Selected = selected;
break;
case "Venues":
ActivityResource actvres = (ActivityResource)dlitem.FindControl("ActivityResource1");
actvID = actvres.ActvID;
actvstr = "=" + actvID.ToString() + ";";
selected = txtbxActvs.Text.Contains(actvstr);
actvres.Selected = selected;
break;
}
}
}
}
}
public string BuildXMLforSelectedActvs()
{
string xmlSelActvs = "";
string xmlactvs = "";
xmlSelActvs = "<Root>";
xmlactvs = txtbxActvs.Text;
xmlactvs = xmlactvs.Replace("=", "<Actvs><ID>");
xmlactvs = xmlactvs.Replace(";", "</ID></Actvs>");
xmlSelActvs += xmlactvs;
xmlSelActvs += "</Root>";
return xmlSelActvs;
}
protected void btnSelectNone_Click(object sender, EventArgs e)
{
txtbxActvs.Text = "";
HighlightSelectedActvs();
}
protected void menuActivityBoxViewMode_MenuItemClick(object sender, MenuEventArgs e)
{
gridviewContacts.DataBind();
}
public void PopulateSubjectTags()
{
PopulateLabelWithTags(ref lblSubjTags, SubjectID, "Subject");
}
public void PopulateLabelWithTags(ref Label lbl, int objid, string TagType)
{
lbl.Text = "";
lbl.ToolTip = "";
string sql = "";
DataSet ds = new DataSet();
sql = sql + " select tbl_tag.id, tbl_tag.descr ";
sql = sql + " from tbl_tag ";
sql = sql + " inner join mtm_obj_tag mot on mot.tag = tbl_tag.id ";
sql = sql + " inner join tbl_tag_typ tagtyp on tagtyp.id = tbl_tag.typ ";
sql = sql + " where mot.objID = " + SubjectID.ToString() + " and ltrim(rtrim(tagtyp.descr)) = '" + TagType + "' ";
sql = sql + " order by tbl_tag.descr ";
ds = CommonFunctions.ReturnResultSet(sql);
if (ds.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
if (i < 2)
{
lbl.Text += ds.Tables[0].Rows[i]["descr"].ToString() + "\n";
}
else
{
if (i == 2)
{
lbl.Text += "more...";
}
}
lbl.ToolTip += ds.Tables[0].Rows[i]["descr"].ToString() + "\n";
}
}
}
protected void drplstActvViewMode_SelectedIndexChanged(object sender, EventArgs e)
{
ActivityViewMode = lblViewMode.Text;
gridviewContacts.DataBind();
}
protected void gridviewContacts_DataBound(object sender, EventArgs e)
{
SetContactRowColors();
HighlightSelectedActvs();
}
protected void btnSaveStructure_Click(object sender, EventArgs e)
{
string sql = "", CntcXml = "", ActvXml = "";
SubjectStructure Subj = new SubjectStructure();
Subj = Subj.GetSubjectStructure(SubjectID);
Subj.contact = null;
int CntcID = 0, actvID = 0, students = 0;
int CntcTyp = 0, DurationCntc = 1, DurationActv = 1;
string grpname = "";
foreach (GridViewRow row in gridviewContacts.Rows)
{
CntcID = Convert.ToInt32(gridviewContacts.DataKeys[row.DataItemIndex].Value.ToString());
CntcTyp = Convert.ToInt32(((DropDownList)row.FindControl("drplstCntcTyp")).SelectedValue);
DurationCntc = Convert.ToInt32(((DropDownList)row.FindControl("drplstDuration")).SelectedValue);
CntcXml += "<Contact><ID>" + CntcID.ToString() + "</ID><CntcTyp>" + CntcTyp.ToString() + "</CntcTyp><Duration>" + DurationCntc.ToString() + "</Duration></Contact>";
DataList datalistActvs = (DataList)row.FindControl("datalistActvs");
if (datalistActvs != null)
{
foreach (DataListItem dlitem in datalistActvs.Items)
{
ActivityBox actvbox = (ActivityBox)dlitem.FindControl("ActivityBox1");
actvID = actvbox.ActvID;
students = actvbox.Students;
DurationActv = actvbox.Duration;
grpname = actvbox.GrpName;
if ((DurationCntc > 1) && !(DurationActv > 1))
{
DurationActv = DurationCntc;
}
ActvXml += "<Actv><ID>" + actvID.ToString() + "</ID><Students>" + students.ToString() + "</Students><Duration>" + DurationActv.ToString() + "</Duration><GrpName>" + grpname + "</GrpName></Actv>";
}
}
}
sql = "sp_Contacts_Update '<Root>" + CntcXml + "</Root>', " + SubjectID.ToString() + " ";
CommonFunctions.ExecuteStoredProc(sql);
string xm = "class";
if (Session["TTBL_TYPE"].ToString() != "CLASS")
{
xm = "XM";
}
sql = "sp_Activities_Update '<Root>" + ActvXml + "</Root>', '" + ActivityNameViewMode + "', '" + xm + "' ";
CommonFunctions.ExecuteStoredProc(sql);
DisplaySubjectStructure();
CommonFunctions.setDataModifiedTime();
}
public event EventHandler SubjectChange;
protected void OnSubjectChange(EventArgs e)
{
if (SubjectChange != null)
{
SubjectChange(this, e);
}
}
private void StructureChanged(object sender, EventArgs e)
{
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
protected void btnSelectAll_Click(object sender, EventArgs e)
{
SelectAllActvs();
}
public void SelectAllActvs()
{
txtbxActvs.Text = "";
string actvstr = "";
int actvID = 0;
bool selected = false;
foreach (GridViewRow row in gridviewContacts.Rows)
{
DataList datalistActvs = (DataList)row.FindControl("datalistActvs");
if (datalistActvs != null)
{
foreach (DataListItem dlitem in datalistActvs.Items)
{
switch (ActivityViewMode)
{
case "Activity":
ActivityBox actvbox = (ActivityBox)dlitem.FindControl("ActivityBox1");
actvID = actvbox.ActvID;
actvstr = "=" + actvID.ToString() + ";";
txtbxActvs.Text += actvstr;
selected = txtbxActvs.Text.Contains(actvstr);
actvbox.Selected = selected;
break;
case "Streams":
ActvStreams actvstrm = (ActvStreams)dlitem.FindControl("ActvStreams1");
actvID = actvstrm.ActvID;
actvstr = "=" + actvID.ToString() + ";";
txtbxActvs.Text += actvstr;
selected = txtbxActvs.Text.Contains(actvstr);
actvstrm.Selected = selected;
break;
case "Staff":
ActivityResource actvstaff = (ActivityResource)dlitem.FindControl("ActivityResource1");
actvID = actvstaff.ActvID;
actvstr = "=" + actvID.ToString() + ";";
txtbxActvs.Text += actvstr;
actvstaff.Selected = true;
break;
case "Venues":
ActivityResource actvres = (ActivityResource)dlitem.FindControl("ActivityResource1");
actvID = actvres.ActvID;
actvstr = "=" + actvID.ToString() + ";";
txtbxActvs.Text += actvstr;
selected = txtbxActvs.Text.Contains(actvstr);
actvres.Selected = selected;
break;
}
}
}
}
}
protected void gridviewContacts_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void SqlDataSourceActvs_DataBinding(object sender, EventArgs e)
{
if (sender.GetType().ToString() == "System.Web.UI.WebControls.SqlDataSource")
{
SqlDataSource sqlDatSrc = (SqlDataSource)sender;
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref sqlDatSrc);
}
}
protected void SqlDataSourceActvs_Init(object sender, EventArgs e)
{
if (sender.GetType().ToString() == "System.Web.UI.WebControls.SqlDataSource")
{
SqlDataSource sqlDatSrc = (SqlDataSource)sender;
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref sqlDatSrc);
}
}
protected void SqlDataSourceActvs_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (sender.GetType().ToString() == "System.Web.UI.WebControls.SqlDataSource")
{
SqlDataSource sqlDatSrc = (SqlDataSource)sender;
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref sqlDatSrc);
}
}
protected void SqlDataSourceCntcTypes_DataBinding(object sender, EventArgs e)
{
if (sender.GetType().ToString() == "System.Web.UI.WebControls.SqlDataSource")
{
SqlDataSource sqlDatSrc = (SqlDataSource)sender;
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref sqlDatSrc);
}
}
protected void SqlDataSourceCntcTypes_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
if (sender.GetType().ToString() == "System.Web.UI.WebControls.SqlDataSource")
{
SqlDataSource sqlDatSrc = (SqlDataSource)sender;
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref sqlDatSrc);
}
}
protected void SqlDataSourceCntcTypes_Init(object sender, EventArgs e)
{
if (sender.GetType().ToString() == "System.Web.UI.WebControls.SqlDataSource")
{
SqlDataSource sqlDatSrc = (SqlDataSource)sender;
CommonFunctions.SetActiveConnectionStringForSqlDataSource(ref sqlDatSrc);
}
}
protected void txtbxActvs_TextChanged(object sender, EventArgs e)
{
Session["Activity_id"] = txtbxActvs.Text;
Session["Selected_ID_Bind"] = txtbxActvs.Text;
Session["Multi_Activity_ID"] = txtbxActvs.Text;
}
protected void txtActivity_TextChanged(object sender, EventArgs e)
{
}
protected void gridviewContacts_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
}
}
And in my Host page and calling it like this
if (e.Item.Text == "Remove Selected" && Session["Array_To_Be_Replaced"] != null && Convert.ToString(Session["Array_To_Be_Replaced"]) != "")
{
ArrayList Activity_IDS = (ArrayList)Session["Activity_IDS"];
ArrayList Array_To_Be_Replaced = (ArrayList)Session["Array_To_Be_Replaced"];
obj.Remove_Cycles(Activity_IDS, Array_To_Be_Replaced, Convert.ToString(Session["ActiveDatabase"]));
Bind_Grid_For_Staff();
<pre> ActivityCtrl1.RefreshUC();
lblAdminStatus.Visible = true;
lblAdminStatus.Text = "Staff Member Removed";
lblAdminStatus.ForeColor = System.Drawing.Color.Green;
Session["Array_To_Be_Replaced"] = null;
}
else
{
lblAdminStatus.Text = "Please Select the Staff Member to be Removed";
lblAdminStatus.ForeColor = System.Drawing.Color.Red;
lblAdminStatus.Visible = true;
}<
RefreshUC is the refreshing method of the UserControl
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
First thing, the gridviewContacts is not assigned with any datasource in your code.
Before calling the DataBind() method for gridviewContacts, you need to set the DataSource for that.
Also the RefreshUC does not have the code to bind gridviewContacts with data.
So address this thins. Hope this will solve your problem.
|
|
|
|
|
The grid is Binded from a SQlDataSource control defined like this
<asp:SqlDataSource ID="SqlDataSourceContacts" runat="server" ConnectionString="< %$ ConnectionStrings:DBConnectionString % >"
SelectCommand="select distinct tbl_cntc.ID, tbl_cntc.CntcTyp, tbl_cntc.Number, tbl_cntc.Duration, count( distinct tbl_Actv.id ) [NumberOfActivities]&#13;&#10;from tbl_cntc&#13;&#10;left outer join tbl_actv on tbl_actv.cntcId = tbl_cntc.ID&#13;&#10;where tbl_cntc.modlID = @ModlID&#13;&#10;group by tbl_cntc.ID, tbl_cntc.CntcTyp, tbl_cntc.Number, tbl_cntc.Duration&#13;&#10;order by CntcTyp, tbl_cntc.Number" UpdateCommand="Update tbl_cntc &#13;&#10; set CntcTyp = @CntcTyp,&#13;&#10; Duration = @Duration&#13;&#10; where ID = @CntcID" >
< SelectParameters>
< asp:ControlParameter ControlID="hfmodlID" Name="ModlID" PropertyName="Value" / >;
< /SelectParameters >
< UpdateParameters >
< asp:Parameter Name="CntcTyp" />
< asp:Parameter Name="Duration" / >
< asp:Parameter Name="CntcID" / >
< /UpdateParameters >
and as Shown above the Page load in the UserControl is like this
protected void Page_Load(object sender, EventArgs e)
{
string clientscript = "";
clientscript = "var txtbxActvClientID = '" + txtbxActvs.ClientID.ToString() + "'; ";
ClientScriptManager cs = Page.ClientScript;
cs.RegisterClientScriptBlock(this.GetType(), "txtbxlookupid", clientscript, true);
if (!Page.IsPostBack)
{
}
HighlightSelectedActvs();
}
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
hiii
i m using asp.net and i m sending a mail using gmail account,everything is fine in sending mail
but in body part code is
msg.Body = "Status is : '" + DropDownList3.SelectedValue.ToString() + "', for the Request of RMA No:'" + DropDownList1.SelectedValue.ToString() + "'";
its give out put in a single line without space, i want result like this
Status is: ******
for the request of RMA no. is: ******
while result is coming like status no: ****** for the request of rma no: *******
please suggest me
thanks
|
|
|
|
|
Environment.NewLine
Change your code like this
msg.Body = "Status is : '" + DropDownList3.SelectedValue.ToString + "<br>', for the Request of RMA No:'" + DropDownList1.SelectedValue.ToString() + "'";
|
|
|
|
|
hi all
How to get MAC address of client system or NIC card in asp.net
|
|
|
|
|
You can get the MAC address of the client using ActiveX object in javascript.
But the security settings of the client browser may prevent you from getting the information. Therefore the client browser security settins needs to be changed manually to allow ActiveX controls which may lead to security threats.
Hope this article[^] will help you to get MAC address of the client using JavaScript.
|
|
|
|
|
hi thanks for ur answer but is it possible in asp.net or in c#?
|
|
|
|
|
I seem to recall earlier versions of Visual Studio offerred the option of opening a web project locally, or on a remote server. Maybe I was imagining it, but I'm fairly sure I screwed up more than once and selected the wrong choice. Whatever... In VS2008 I can't find a way to do this, and I'm not really sure it's possible. I've searched MSDN and Help with the usual results.
Anyway, I've got the bare bones of an app hosted in a subdomain and I'd really like to continue developing it there, rather than ftp-ing back and forth every time I work on it. Not only would this be more convenient now, it will be handy later for site maintenance when I move it to its home domain.
Is this possible? If so, how do I accomplish it?
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|