|
|
Wowwww
It really works!!!
Alexei Rodriguez
|
|
|
|
|
I am trying to setup a site where I connect to an SAAS system via an iframe in my default.asp page. However I seem to be having troubles getting the iframe to pass a variable in the URL.
Here's what I'm trying to do. If I click on the following link, I am immediately logged in as a guest at the SAAS site. Just pasting the link in my browser works correctly.
http://www.mywebapp.com/home/login.asp?FromLogin=1
However, if i use the same URL an iframe, it doesn't seem to pass the variable because I end up at the login page.
<iframe src="<a href="http://www.mywebapp.com/home/login.asp?FromLogin=1">
Can anyone provide a suggestion? This is driving me nuts!
Thanks in advance for your help!
|
|
|
|
|
Hello Everybody .
I am creating a custom control and i am trying to make it raising events
i inherited from IPOSTBackEventHandler interface and implemented its method
but in vain , the control still doesn't have any effect when it is clicked on the page
the code for the control is as follows
<br />
public class CustomButton : Control , IPostBackEventHandler , IPostBackDataHandler<br />
{<br />
public event EventHandler Click;<br />
<br />
protected override void Render(HtmlTextWriter writer)<br />
{<br />
writer.Write("<input type="\"Submit\"" name="\"ClickButton\"" value="\"Click" me="" mode="hold" /> }<br />
<br />
#region IPostBackEventHandler Members<br />
<br />
public void RaisePostBackEvent(string eventArgument)<br />
{<br />
OnClick(new EventArgs());<br />
}<br />
protected virtual void OnClick(EventArgs e)<br />
{<br />
if (Click != null)<br />
Click(this, e);<br />
}<br />
<br />
#endregion<br />
<br />
#region IPostBackDataHandler Members<br />
<br />
public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)<br />
{<br />
Page.RegisterRequiresRaiseEvent(this);<br />
return true;<br />
}<br />
<br />
public void RaisePostDataChangedEvent()<br />
{<br />
<br />
}<br />
<br />
#endregion<br />
}<br />
<br />
What is the problem
Human knowledge belongs to the world.
|
|
|
|
|
Hi All,
Is'nt there a RichTextBox(Like in WinForms)for Asp.Net? What can i use to show some logactions from the database?
Thanx.
|
|
|
|
|
Hi,
I have a web app in asp.net 1.1 . I've created resource files (.resx), and need to add images to it that can then be displayed using the html img tag. How do I load images into .resx files? Should I be loading the image or a path to an image?
Also, I'd like to place all resource files in a sub-directory in the root, and then have them be compiled and placed in a dll in the bin dir. How do I do this? As of now, the only option I see is that I place all the .resx files in the root, and VS will compile them, and place them in a dll in the bin folder. I'd like to see the many .resx files in a dir of their own. How do I do this, and have the vs compiler find them?
Thanks.
Shefali
|
|
|
|
|
I have created a custom gridview control programatically and added checkbox to the template field.below are the steps followed to add the template filed to the gridview
TemplateField tempField = new TemplateField();
tempField.ItemTemplate = new GridViewTemplate(DataControlRowType.DataRow, "TemplateField");
tempField.HeaderTemplate = new GridViewTemplate(DataControlRowType.Header, "TemplateField");
grvGridView.Columns.Add(tempField);
public class GridViewTemplate : System.Web.UI.Page, ITemplate
{
private DataControlRowType fTemplateType;
private string fColumnName;
CheckBox rowCheckBox;CheckBox headerCheckBox = new CheckBox();
public GridViewTemplate(DataControlRowType type, string colname)
{
fTemplateType = type;
fColumnName = colname;
headerCheckBox.ID = "hdrCheckBox";
}
public void InstantiateIn(System.Web.UI.Control container)
{
switch (fTemplateType)
{
case DataControlRowType.Header:
container.Controls.Add(headerCheckBox);
break;
case DataControlRowType.DataRow:
rowCheckBox = new CheckBox();rowCheckBox.ID = "chkUserCheckBox";
container.Controls.Add(rowCheckBox);
break;
}
}
}
once the gridview is bound checkbox is getting rendered perfectly .. but once i select the checkboxes and click button i am unable to locate the checkboxes in the gridview ... getting error(Object Reference not set to an instance) at the lines of code numbered below
CLICK EVENT OF BUTTON
{
foreach(GridViewRow gvr in GridView.Rows)
{
1. CheckBox chkbox = (CheckBox)(gvr.FindControl("chkUserCheckBox")) // First Way tried to get the reference of checkbox
2. CheckBox chkbox = (CheckBox)gvr.Cells[0].Controls[0] // Second Way tried to get the reference of checkbox
}
}
Can anyone please help me resolving the issue .
|
|
|
|
|
Hi friends,
I have to create a Message board. I'm planning to create a class for this, whick is going to include a collection of messages. This is the general idea:
MessageBoard Class
UserId
Collection of Messages
AddMessage()
RemoveMessage(messageID)
MarkAsRead(messageID)
MarkAsUnread(messageID)
Message Class
MessageBoardId
Text
Read
I have read some about Collections I saw some examples where they use ArrayList, SortedList and CollectionBase among others for this. What do you think is the most suitable Collection type to use in this case?
Thanks a lot
|
|
|
|
|
Is there a possibility to include horizontal scroll bar in asp.net 2.0 List box control? though i tried out many possibilities, i couldn't find out..Have got any idea about this? Thanks in advance.
Muthu
|
|
|
|
|
Put the control in a div tag perhaps.
I didn't get any requirements for the signature
|
|
|
|
|
Well, I tried even putting a div element with its scroll property set to auto. Was helpless.!?!
Muthu
|
|
|
|
|
some properties to try setting on your div tag.
style="width:300px; display:block; overflow: scroll; height:200px;"
I didn't get any requirements for the signature
|
|
|
|
|
Instead of div, you can also use a panel control and set the corresponding properties like haight and scrollbars
Alexei Rodriguez
|
|
|
|
|
thanks a lot, that works fine.
Muthu
|
|
|
|
|
I want a js function using confirm js function to determine whether the user wants to exit the current page, by the onunload js event.
That is when user unloads a page, there must be a confimation, whether user really wants to exit.
When i press ok, i must retain the current page. if cancel is clicked then current page must be closed.
any sample piece of code available..Thanks for reading..
Muthu
|
|
|
|
|
See the js function in the post message here at codeproject
If you have something writen and try to go back or toa new page, it asks you if you really want to do that
Alexei Rodriguez
|
|
|
|
|
what is the subject name? i could not find, unless i have some keyword.?!
Muthu
|
|
|
|
|
No, i meant:
Go to "New message" as if you were gonna post a new message and see how it works
You are gonna have to look for that js function,, maybe it is embeded in the html or maybe it is in an external .js file
Alexei Rodriguez
|
|
|
|
|
I am running into an issue with the fileupload control.
Standard code... just a test After clicking on button1 I do get the Yay response. Clicking button1 again right after, I get the Nay response. However, if I choose a file and then click on button1 and it has a file, I get the Yay response and the text in the upload control clears. I refresh the page, and I get the Yay response. Is there a way to control this?
protected void Button1_Click(object sender, EventArgs e)
{
if (this.FileUpload1.HasFile)
{
Response.Write("Yay!");
}
else
Response.Write("Nay!");
}
|
|
|
|
|
That is how the file up load works. The file upload control will post the file only once.
Think about it. If you have a file selected by the user, would you want that file to be sent to the server on every additional postback?
protected void Button1_Click(object sender, EventArgs e)
{
if (this.FileUpload1.HasFile)
{
Response.Write("Yay!");
//Implement method to save file
}
else
Response.Write("Nay!");
}
I didn't get any requirements for the signature
|
|
|
|
|
I understand that's how it should work. And no, I don't want the file to be sent on every postback. Just if you click an upload button with a file in the upload control, and a user clicks refresh on their browser, the same action is performed and the upload control still is showing HasFile = true. I'm trying to not let the code to add a file run again if a browser refresh is performed after clicking upload.
modified on Friday, September 26, 2008 3:32 PM
|
|
|
|
|
Anyone?
Revolutionary: Disk drives go round and round.
|
|
|
|
|
I am looking into loading the content of a usercontrol from a database instead of from a ascx file. I have found some information on ControlParser but I have been unsucessful in getting it to work.
Does anyone have any examples of loading a control in this manner?
Thanks
|
|
|
|
|
Wow. That sounds like a great plan
Are you seriously trying to store code in a database? Why would you do that?
I didn't get any requirements for the signature
|
|
|
|
|
This is only for page template layouts so that I can allow the user to choose from a layout or copy it and edit it themselves.
|
|
|
|