|
Hi,
You've created the function sendmail(), but never call it to execute. Either pull the code out of function and let it process as the page is processed, or add a call to the function at the end of your script block.
|
|
|
|
|
Hi all,
I have a dropdownlist into a detailsview under vb.net (asp.net) and I want controller when user is in mode "insert" or "edit" this dropdownlist for enable or disable a textbox (into detailsview also) depending of value of dropdownlist.
Without detailsview is easy, put dropdownlist in mode postback and I controller .value but with detailsview I don't know how controller it.
Any idea?
thanks very much.
|
|
|
|
|
I have an aspx page. In that page I am displaying div when click on link. Div contains iframe and i am assigning url to the frame like below.
<asp:linkbutton id="lkbtn" text="Create" onclientclick="return ShowDiv(this)" runat="server">
// Function to Show the Div //
function ShowDiv(CtrlName)
{
document.getElementById('divUserCtrl').style.display = 'inline';
frames['ifrm'].window.location = "CreateProject.aspx?ProjCat=G";
return false;
}
when click on linkbutton can able to display div and redircting to CreateProject page. But in CreateProject when click on a button i need to close this div. How can I do this in c#. I tried like Page.RegisterStartupScript("Reload", "window.close();"); But no luck
|
|
|
|
|
First, please remember to format any code you post using the pre tags as explained in the forum guidelines.
Second, follow the advise given. This is a cross post and since you have not indicated that will most likely just get ignored, at best.
Your experience here will be more gratifying if you learn to follow the rules and listen to advice.
You can't close it from c#. You will need to have the page being displayed in the iframe call javascript method to close the containing div.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Button is in one 2.aspx page and frame in 1.apsx. How can I Close frame in 1.aspx from 2.aspx. My subject itself mentioned close frame in javascript not in c#.
|
|
|
|
|
SatyaKeerthi15 wrote: My subject itself mentioned close frame in javascript not in c#.
From your original post:
"How can I do this in c#. I tried like Page.RegisterStartupScript("Reload", "window.close();"); "
How much control do you have over the page being displayed in the frame? Is it your, or are you lining to another site?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi,
i have a master page and has some menu items, i am handling its
ClientClick event using Ajax. if i want handle the ClickClick
event on content page, then how can handle it at content page?
Actually clicking of menu set the visibility of buttons, and buttons are in
content page. so i wanted make it at client side without triping.
|
|
|
|
|
If you want the event handler of Control present in master page, in your content page, you can go do something like this:
protected void Page_Init(object sender, EventArgs e)
{
Button btn = (Button)this.Master.FindControl("btnMaster");
if (btn != null)
btn.Click += new EventHandler(btn_Click);
}
protected void btn_Click(object sender, EventArgs e)
{
Response.Write("Button Clicked.");
}
where btnMaster is a Button in Master Page. I guess you need to do the same for Menu Item.
amit_83 wrote: so i wanted make it at client side without triping
If you want to do it in client side, there is no concept of master and content page. Try with some javascript based on the client side code it generated.
|
|
|
|
|
hi,
i was added two template fields in Grid view one="Drop Down List" two="Text Box",here i need to disable text box while Drop_down_on_Change event with some selection Fields only ,my requirement is like,
"Drop Down List" has two items , one is "Country" and Second one is "State",
if user Select country in Drop Down then Text box should be disable false else Text box should be disable True (i need client side code).Please suggest me better way to fix.
Thanks & Regards,
Vishnu.
|
|
|
|
|
Hi Guys i have a data format like this format...,
<table>
<tr><td>Head1</td><td>Head2</td><td>Head3</td></tr>
<tr><td colspan='3'>some value</td></tr>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
<tr><td colspan='3'>some value dasfs</td></tr>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
<tr><td>value1</td><td>value2</td><td>value3</td></tr>
</table>
Now i want to export the values to .CSV format...,
In lower version of .CSV(2000) its showing datas properly...,
the same thing if i open in 2007 CSV format...,
i am getting the records how i mentioned in above(table) the sme way i am getting (i.e) with table...,
this is my code:
string strData = "<table>.......</table> //the above table format i given here
Response.Write(strData);
byte[] data = ASCIIEncoding.ASCII.GetBytes(strData);
Response.Clear();
Response.ContentType = "text/csv";
Response.AddHeader("content-disposition", "attachment;filename=" + _UserID + "Stock" + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + ".csv");
Response.BinaryWrite(data);
Response.End();
plz help me regards this...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
I don't see where you said what the actual problem is.
There is no such thing as CSV2000 or CSV2007. CSV stands for comma separated values. It is a text file. HTML is not CSV. Telling an application you are giving it CSV data when you are actually giving it HTML would definitely lead to unpredictable results. If you want to save as CSV then do the parsing to actual produce CSV. Load your HTML into either an HTMLTable object or an XMLDocument object and create a proper CSV. Since you are not using the proper quotes for your attributes it may be a little tricky
|
|
|
|
|
((parentPage)Parent.Page).callChildMethod();
As above i called a method which assigns parent control Label to new values from user control server side page, i debug the code and it showed me the value is changed correctly which is to be, when the method call gets over it comes inside the user control again and leaves the User control but when the page doesnot showing the changed values unless we give click on the parent page to load again.
Method inside Parent .aspx.cs Page which Holds User Control
public void callChildMethod()
{
Label1.text="value";
}
Above Label Value gets changed when i call method but the page not getting refreshed to show the new values.
|
|
|
|
|
Hi!
AFAICT, you are approaching the problem in the wrong way.
If you refresh the child control it's via async postback. This means that the browser will refresh only the area associated with the control. IT WILL NOT REFRESH parent controls.
What you see is being updated is the server side counterpart of the parent control's label, which is reconstructed over and over by asp.net at each partial postback.
If you want to update the parent control's label, you should probably do it via javascript and ClientScriptManager (if you are already using Ajax extensions).
I hope this can clarify you what's actually happening!
Bye
|
|
|
|
|
hi
Yes, i agree can you give me some example how can we do that .,
|
|
|
|
|
Hi everyone,
I have one question I can't seem to find an answer for...
Is there a simple way to ensure an aspx file deployed to a remote server has not been modified?
I'm thinking of something a bit like strong name signing: a way to detect at run time if the aspx file has been modified after deployment.
I mean: I can compile every aspx.cs file into a dll and sign the resulting file, but it seems I cannot do something similar with aspx files.
Thank you all in advance.
Alberto
|
|
|
|
|
When you pre-compile the application the code behind and aspx files placed into the assembly, there are aspx files also but they are merely placeholders (even says so in the file)
If you have are worried about someone changing the aspx after deployment then I think you have other concerns that need to be addressed first.
I know the language. I've read a book. - _Madmatt
modified on Wednesday, September 1, 2010 1:44 PM
|
|
|
|
|
Mark Nischalke wrote: When you compile the application the code behind and aspx files placed into the assembly, there are aspx files also but they are merely placeholders (even says so in the file)
IIRC that is a build option and not the default option?
|
|
|
|
|
Correct, I should have clarified that.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thank you Mark and Ennis!
Yes, I know that I have a lot of things to watch for before.
In fact, taking care of them is my current concern.
I was simply investigating if it's possible to secure this particular aspect of a webapp.
Thank you much for answering to my question.
I think I can't find the exact option you two are referring to; could you tell me how it's called (I should probably RTFM, I know).
Thank you much!
|
|
|
|
|
|
|
Hi All,
I am currently fighting with a problem with regards to finding controls within ContentPlaceHolders.
The scenario is that I want to be able to set the class on a control with a specified ID, which is on one of the Master pages which the page inherits from. There is no limit to how many levels up the tree the control can be, and the code searches recursively until the root master page. This part I have working.
The issue that I am having is that I can only find a control if it is on the root master page.(I.e. not within a ContentPlaceHolder). If the control is on any other page then FindControl() does not find the control. In this example, the control would only be found if on DefaultMaster.
DefaultMaster
--> SectionMaster
--> PageMaster
--> Page.aspx
I have investigated further, and found that controls within a Content control are being retured as null, although they clearly exist. Obviously as these are null, FindControl can't find them. I have tried attempting to find a control within the content section also, but I have the same issue.
Unfortunately, if you take the above example, then my control would be in SectionMaster, as I dont have access to the root master page. (I'm using Umbraco currently for this project.)
Does anyone have any suggestions to how to get these values from content controls?
Thanks in advance,
DM.
|
|
|
|
|
What event in the Page Lifecycle is your code running? Child controls generally will not be available until after the load event fires for said control.
That said, code is not supposed to access controls up the hierarchy only below it. If you need to access something from your parent container, the parent should provide a method to perform said action. Otherwise you introduce unmanageable dependencies.
|
|
|
|
|
I'm using the Page_Load event on the User Control.
What I do at first is a FindControl() on the current control, if its not found, it does a a FindControl() on the page which the control is on. If thats not found, it looks at the Master for that Page and continues to do this until the control is found, or it is the root masterpage.
It only seems to find controls outwith the content place hold on the root masterpage or nested content controls. Interestingly, on the Controls collection, it shows the correct number of the page, however some are shown as null. I'm sure the nulls are where my controls I need to find are.
Thanks
DM
|
|
|
|
|
Hi All,
I am new to Windows7 and IIS7 environments. Here at client site, I have a machine in which I am not finding ASP.Net state service in my services list. Is there any way to add ASP.Net state service to the services list. I need this service to be added because the application I am running is using ASP.Net state server services. Any link or any explanation would be great helpfull.
I need this support for Windows7 and IIS7.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|