|
ContentPlaceHolder content;
content = Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
for ex
TextBox txt=content.FindControl("txtName") as TextBox;
Raju.M
|
|
|
|
|
how can we access outlook address book in an windows application.
i have done this
private Outlook.Application objoutlook = null;
private Outlook.NameSpace objNamespace = null;
private Outlook.MAPIFolder objFolder = null;
Outlook.ApplicationClass appOut = new Outlook.ApplicationClass();
Outlook.SelectNamesDialog oSND = appOut.Session.GetSelectNamesDialog();
Outlook.AddressList x = oSND.InitialAddressList;
foreach (Outlook.AddressEntry y in x.AddressEntries)
{
if (y.AddressEntryUserType ==
Outlook.OlAddressEntryUserType.olExchangeUserAddressEntry)
{
Outlook.ExchangeUser u = y.GetExchangeUser();
string t = u.GetContact().FullName;
string L = u.GetContact().BusinessAddressCity;
}
}
this coding i did for office 2007 but i am not getting for 2003 office outlook .
Thanks
|
|
|
|
|
I have a usercontrol, which takes datatable as a property and creates dynamic dataentry facility (Add/Edit) in gridview.
Parent control class I have a gridview, whosed columns are templated columns which I create dynamically:
TemplateField tf = new TemplateField();
tf.HeaderTemplate =
new DynamicallyTemplatedGridViewHandler(ListItemType.Header,
dt.Columns[i].ColumnName, dt.Columns[i].DataType.Name);
tf.ItemTemplate =
new DynamicallyTemplatedGridViewHandler(ListItemType.Item,
dt.Columns[i].ColumnName, dt.Columns[i].DataType.Name);
tf.EditItemTemplate =
new DynamicallyTemplatedGridViewHandler(ListItemType.EditItem,
dt.Columns[i].ColumnName, dt.Columns[i].DataType.Name);
I have used the following class
class DynamicallyTemplatedGridViewHandler : ITemplate
and created methods
public void InstantiateIn(System.Web.UI.Control Container)
{
switch (ItemType)
{
...
...
...
case ListItemType.EditItem:
switch (InfoType)
{
...
...
...
case "DateTime":
pages_control_DateBox field_datebox = new pages_control_DateBox();
field_datebox.ID = FieldName;
if ((int)new Page().Session["InsertFlag"] == 0)
field_datebox.DataBinding += new EventHandler(OnDataBinding);
Container.Controls.Add(field_datebox);
break;
...
...
...
}
private void OnDataBinding(Object sender, EventArgs e)
{
object bound_value_obj = null;
Control ctrl = (Control)sender;
IDataItemContainer data_item_container = (IDataItemContainer)ctrl.NamingContainer;
bound_value_obj = DataBinder.Eval(data_item_container.DataItem, FieldName);
switch (ItemType)
{
...
...
...
case ListItemType.EditItem:
switch (InfoType)
{
...
...
...
case "DateTime":
pages_control_DateBox field_dateBox = (pages_control_DateBox)sender;
field_dateBox.Text = "";
field_dateBox.CalendarDate = bound_value_obj.ToString();
break;
...
...
...
}
Now, in case of a DateTime field, for edit template, I use my own user control "DateBox". Now, when I click on the edit icon on my grid, I get the following error:
Object reference not set to an instance of an object.
Someone please help.
Do let me know, in case more information is required.
|
|
|
|
|
is sender NULL when case "DateTime" ?
Put a breakpoint on that line, and see if sender is instance of something.
Let me know,
Calin
|
|
|
|
|
sender is not null.
Till binding every step works fine, but as soon as it wanted to display the DateBox, it is not able to.
Point is I have this GridUserControl and inside it, I want to bind this DateUserControl. I guess I have to make some change in the code of DateUserControl so that it can instantiate properly.
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 pages_control_DateBox : System.Web.UI.UserControl
{
private void Page_Load(object sender, System.EventArgs e)
{
string scriptStr = "javascript:return popUpCalendar(this, document.getElementById('" + getClientID() + @"'), 'mm/dd/yyyy', '__doPostBack(\'" + getClientID() + @"\')')";
imgCalendar.Attributes.Add("onclick", scriptStr);
}
#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
public string getClientID()
{
return txt_Date.ClientID;
}
public string CalendarDate
{
get
{
return txt_Date.Text;
}
set
{
txt_Date.Text = value;
}
}
}
I am not sure, what to change.
|
|
|
|
|
Hi
We have a backoffice system for an e-Commerce solution that allows the user to setup their own javascript blocks that can be added to the site for tracking purposes.
Now when we click submit on the form to save the entry the page hangs, now I have created a test form and now know its not making it back to the Page_Load event of the form. The other weird thing is that every now and again everything works perfectly ok without issue and then just when you think you've narrowed the problem down it stops working again!! The page always renders immediately without problem, the issue only occurs on the post back.
This seems to be very strange and I am at a loss as to the source of the problem, below is the script block I am using to test.
Any ideas?
<!-- PARTNER TRACKING --><br />
<br />
<!-- Google --><br />
<script src=" https://ssl.google-analytics.com/urchin.js" type="text/javascript"><br />
</script><br />
<script type="text/javascript"><br />
_uacct = "[google.account]";<br />
urchinTracker();<br />
</script><br />
<br />
<!-- ATLAS Neutalize --><br />
<script language="javascript" src="https://track.roiservice.com/track/track.aspx?ROIID=[roid.no]"></script><br />
<script language="javascript"><br />
<!--<br />
var strMsg = '[script.var.mode]';<br />
var strSubTotal = '[script.var.order.value]';<br />
<br />
if (strSubTotal == '')<br />
strSubTotal = "0";<br />
<br />
if (strMsg == '')<br />
{<br />
if (typeof(ROIID) + '' != 'undefined') {<br />
TrackEvent('LandingPage', 0);<br />
}<br />
}<br />
else<br />
{<br />
if (strMsg.substr(0,32) == 'Thank you for placing your order')<br />
{<br />
if (typeof(ROIID) + '' != 'undefined') {<br />
gt_cid="CustomerID";<br />
TrackEvent('Sale', '[script.var.order.value]', '[script.var.order.no]');<br />
}<br />
}<br />
else if (strMsg == 'Thank you for adding your email address to our mailing list.')<br />
{<br />
if (typeof(ROIID) + '' != 'undefined') {<br />
TrackEvent('NewsConf', 0);<br />
}<br />
}<br />
else if (strMsg == 'Thank you for recommending one of our products to your friends.')<br />
{<br />
if (typeof(ROIID) + '' != 'undefined') {<br />
TrackEvent('EmailConf', 0);<br />
}<br />
}<br />
else if (strMsg == 'Thank you, your comments have been forwarded to our customer care team and we will respond to you as soon as possible.')<br />
{<br />
if (typeof(ROIID) + '' != 'undefined') {<br />
TrackEvent('CommtsConf', 0);<br />
}<br />
}<br />
else<br />
{<br />
if (typeof(ROIID) + '' != 'undefined') {<br />
TrackEvent('LandingPage', 0);<br />
}<br />
}<br />
}<br />
<br />
</script><br />
<br />
<!-- End PARTNER TRACKING --><br />
|
|
|
|
|
Plot thickens LOL!!!
if I enter this: -
<br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
<script></script><br />
it hangs, take one of those lines off and it works!
|
|
|
|
|
SOLUTION
It transpires that the Network Switch has a Intrusion Protection facility that was determining the form to be a malicious attack and preventing its submission!
|
|
|
|
|
my application have 60 checkboxes and
each individual three checkboxes at time one one select creat one pair
and this 20 make pair
store in database only 20 pair selected checkboxes
do not use checkboxlist
so plz give me solution and give small example relelated my application
modified on Monday, February 16, 2009 4:03 AM
|
|
|
|
|
I think you want a checkboxlist control.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
JAS GIRI wrote: do not use checkboxlist
Instead of replying to me, you edit your post to say that you don't want to use the right tool for the job ? I'm afraid that based on your vague description, and request that someone write your code based on this very incomplete spec, you are going to get zero help here or anywhere else. It's just not possible to help you.
I think you want to show groups of three checkboxes, and each group is stored as a single value in the DB, that is, there are three possible choices, on 20 questions. A checkboxlist for each group of three is the logical way to do this. Also, I'd write a control that shows the three checkboxes and returns one of three values via an enum, so that I could easily reuse that to make my 20 questions.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
chandhuBTS wrote: In windows application.
Then you're a bit of a moron, aren't you ? This is the ASP.NET forum.
The error means what it says. You must be REALLY stupid to think that we can work out what's wrong with your code without seeing it. We have no idea where the bytes are coming from, but we can tell you that they are not in a valid image format. If you can't work that out yourself, step away from the computer and find a new hobby/career.
Bloody hell.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
1) Is there any way to Block or Disable File-Save As in WebSite. Can we do anything in the coding side.
2) Is there any way to Block to Taking the Screen Shot [ Print Screen ] of the Web Page.
3) Is there any way to Block to taking the Javascript files from Our Site. Suppose if someone takes View-Source they know where the Javascript is and type that path in the browser they will get that javascript file. can we block that.
|
|
|
|
|
It's like you have no idea what ASP.NET is, or how it works. It emits HTML to the client. Your server side code is not involved in anything that happens on the client side, once the code is emitted.
No. You can stop right clicks and this will mean people who want your source will need to invest another couple of minutes, but at the end of the day, there is NO way to stop any of this. There isn't even a way to pretend to try and stop screenshots.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
hii,
i hav a problem ...
i hav a asp.net with c# web application.in which i display data from database in grid view........
the problem..is this...if the data for a perticular entry and field is more than one line....or the statment is long in single line..........then my gridviiew...expand in width due to.....the lengthy data in perticular entry......this gives very ugly look to gridview view.......
is there any way by which i can fix the size of the cell in the grid view....and if data in perticular cell is more....then it becomes multiline data....and as a result the size of grid view remains fixed.
pzzz help mee..
|
|
|
|
|
You can use css to specify the width of the column, and you can write code to format your output to make it a fixed width.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi There,
I had taken 31 column in grid view.But when I take 32 column and run the project then it throws an exception as index out of rage.Can any one tell me how many column allowed in grid view.
Thanks.
|
|
|
|
|
I am sure that 32 columns would be fine.
Perhaps if you posted the code ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
protected void gvDispatch_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowIndex == -1)
{
if (ddlType.SelectedValue == "D")
{
for (int i = 1; i < 32; i++)
{
gvDispatch.Columns[i].HeaderText = i.ToString();
}
}
}
}
public void fillGrid(GridView gv, string type)
{
DataSet ds = new DataSet();
string qry = "";
qry = "select OADET_ID,Item_descriptioin from MAS_ITEMMASTER,MAS_SALES_ORDER_DETAIL WHERE OADET_ITEM_ID=ITEM_ID and OADET_CM_COMP_ID=1 and OADET_BM_ID=1 and OADET_DELETE=0";
ds = CommonClass.objcon.GetDS(qry); //GetDS is my Common Class Method
gv.DataSource = ds;
gv.DataBind();
}
Exception:-
Index was out of rage.Must be non-negative and less than the size of collection.Parameter name index.
|
|
|
|
|
ais07 wrote: f (ddlType.SelectedValue == "D")
{
for (int i = 1; i < 32; i++)
{
gvDispatch.Columns[i].HeaderText = i.ToString();
}
}
}
}
So you don't have that many columns, and it blows up. Use gvDispatch.Columns.Length ( or Count, whatever it is ) instead of hard coding what is apparently a false assumtpion.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
HI all,
I have a datagrid with one field link buttons(in this field some paths are there).When i am clicking that field ,i want to get the path
Thanks in advance!!!
|
|
|
|
|
If the path is there, then you have it, right ? Or, what do you mean ? I would imagine you want to get an id and look up the path, or store the path against the item.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Actually my requirement is ,i have a customized media player,and when i am clicking the field,i want to get the path in a string ,then i can give it to the player to play
|
|
|
|