|
AFAIK modal dialog is on client so cannot close it using vb code. you have to use javascript which you will call on onunload of body something like it..
when you open a dialog open it like
modaldlog = window.showMOdalDi... (where modaldlog is global var to page)
on unload of parent page
if(modaldlog){modaldlog.close();}
-----
|
|
|
|
|
Hi, I Just Started to build this project. Everything is going on well until I came to user login page. I am getting a error msg Error 1 'ASP.login_aspx' does not contain a definition for 'Login1_Authenticate' File: Login.aspx Line 24
May be I need a code to authenticate username and password.
Can someone provide me a good code for this in C#
Database is already created as ASPNETDB.MDF for login user ids.(automatically created through login tool box)
I am using .NET 2005 to develop this.
Thanks
|
|
|
|
|
Sounds like you login control has an event property set but you don't have the method it refers to in your code-behind. Have a look in the markup of the aspx page for Login1_Authenticate
|
|
|
|
|
That ocurrs when you have a defined event handler on a control in the markup, but not defined the function in the codebehind file. For example, if in the markup, you declared <asp:Button OnClick="button_clicked" runat="server"......>] then in the codebehind, you must have declared a function with the following prototype:
<code>
protected void button_clicked (object sender, EvenArgs e).....
</code>
-- modified at 18:51 Monday 12th March, 2007
oops!
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi,
I have a web service that must return a URL as a return value from one of its requests. I want this URL to be full, i.e. it should include the same protocol (http or https), the same server name/port name and possibly subdirectory as the URL that was used to call this particular webservice.
Basically, what I would like to achieve is for the Webservice to run code like this:
String strFullUrl = RelativeUrlToFullUrl( String.Format( "~/SomeAspxPage.aspx?param1={0}", param ) );
I initially thought that Page.ResolveUrl would do that for me. However, I don't have access to a Page object within a Web Service, but apparently a System.Web.UI.WebControls.Image also contains a ResolveUrl method. Unfortunately, it only returns a URL relative to the root, but does neither contain the name of the server running the web application, nor the protocol.
Is there a function somewhere in ASP.NET that will do this for me? Doing this on the client side is probably possible, but is going to be less elegant so I would prefer if the webservice could handle this completely.
Regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
HttpContext.Current.Request.Url.AbsoluteUri
- walter
|
|
|
|
|
I apologize in advance for the detail in this post...but w/o it, I don't think it will be clear. (code snippet below)
I have been trying to follow an example discussed at http://msdn2.microsoft.com/en-us/library/ms972948.aspx. I have a very similar application - attempting to update a row in a collection of objects bound to a GridView object through an ObjectDataSource. I have 2 methods on a DAL object that I have provided for the ObjectDataSource: getALMPropDataTable() and <b>updateALMProp( int almPropNbr, String almPropNm, String almPropVal)</b>. The getALMPropDataTable() works perfectly, no issues. However, when attempting the Update, a problem arises...
1) Clicking the Edit Button (1st col) of the GridView seems to work OK...and the one column that is editable appears w/ a TextBox - no problem there.
2) In this mode, the Edit Button is replaced w/ an Update and Cancel Button pair as expected - no problem there.
3) When clicking the Update Button, the updateALMProp( int almPropNbr, String almPropNm, String almPropVal) method is called (as expected), however, Trace.Warn messages that I have placed just inside this method reveal the following:
ALMPropVwDAO.updateALMProp() from DAO Layer...
<b>almPropNbr: 0 almPropNm: almPropVal: stuff</b>
Only the 3rd argument is received. No matter what row I attempt to update, I get this same behavior (the 0 value of almPropNbr is always zero regardless of row since this type is Int32 - ie: I don't get the row number as expected). The almPropNm value is empty (it should be name of the property... so that's a problem). Only the value typed into the TextBox on the row in Edit mode actually comes across. The almPropNm is actually the key needed to get the right object of the collection, so consequently no update can performed (the almPropNbr value is technically not required for the update, it is just a row marker for log tracing). If anyone has any ideas, I'd appreciate it...thanks in advance.
Here's the aspx file:
<asp:GridView ID="GridViewALMProp" runat="server" AutoGenerateColumns="False" Width="400px" BackColor="White" BorderColor="#999999"
DataSourceID="ObjectDataSource1" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" ForeColor="Black" GridLines="Vertical"
AllowPaging="True" AllowSorting="True" EmptyDataText="No records found" PagerSettings-Mode="NumericFirstLast" PageSize="5" >
<FooterStyle BackColor="LightGray" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="Gainsboro" ForeColor="Blue" HorizontalAlign="Center" />
<HeaderStyle BackColor="DarkBlue" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#00C000" ForeColor="White" />
<Columns>
<asp:CommandField ShowEditButton="True" ButtonType="Button" />
<asp:BoundField DataField="ALMPropNbr" ReadOnly="true" HeaderText="Number" SortExpression="ALMPropNbr" />
<asp:BoundField DataField="ALMPropNm" ReadOnly="true" HeaderText="Property Name" SortExpression="ALMPropNm" />
<asp:BoundField DataField="ALMPropVal" HeaderText="Property Value" SortExpression="ALMPropVal" />
</Columns>
<PagerSettings Mode="NumericFirstLast" />
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="ALMPropVwDAO" SelectMethod="getALMPropDataTable" UpdateMethod="updateALMProp">
<UpdateParameters>
<asp:Parameter Name="ALMPropNbr" Type="Int32" />
<asp:Parameter Name="ALMPropNm" Type="String" />
<asp:Parameter Name="almPropVal" Type="String" />
</UpdateParameters>
</asp:ObjectDataSource>
Here's the method called:
public static void updateALMProp( int almPropNbr, String almPropNm, String almPropVal)
{
HttpContext.Current.Trace.Warn("ALMPropVwDAO.updateALMProp() from DAO Layer...");
HttpContext.Current.Trace.Warn("almPropNbr: " + almPropNbr + " almPropNm: " + almPropNm + " almPropVal: " + almPropVal);
try
{
// get ALM object from Session
ALM alm = (ALM)HttpContext.Current.Session[RequestConstants.ALMObj];
HttpContext.Current.Trace.Warn("ALM from Session: " + alm.ToString());
ALMProp[] almProps = alm.ALMProps;
for (int i = 0; i < almProps.Length; i++)
{
HttpContext.Current.Trace.Warn("almPropNm: " + almPropNm + " | " + "almProps[i].ALMPropPK.ALMPropNm: " + almProps[i].ALMPropPK.ALMPropNm);
// find entry in ALMProp Array and update value
if (almProps[i].ALMPropPK.ALMPropNm.Equals(almPropNm))
{
HttpContext.Current.Trace.Warn ("found ALMProp[] object, i= " + i);
almProps[i].ALMPropVal = almPropVal;
}
}
alm.ALMProps = almProps; // set updated Array back on ALM object
// place ALM object back on Session
HttpContext.Current.Session[RequestConstants.ALMObj] = alm;
}
catch (Exception)
{
}
}
|
|
|
|
|
I got this resolved...I battled this issue for an entire day trying to figure out what the issue was and found that the single attribute DataKeyNames was missing...when you use a GridView to handle SELECTS, this is of course not required. I found the documents at http://msdn2.microsoft.com/en-us/library/aa905796.aspx to be EXTREMELY helpful. Hopefully others will find them helpful as well...
|
|
|
|
|
Hello friends i tried to use the master page in my site and used the content page in it then i droped a Button control on this content and tried to execute it,this error occurd ,
Control 'ctl00_ContentPlaceHolder2_Button1' of type 'Button' must be placed inside a form tag with runat=server.
i tried to use the form into my content it gives the same error can u help please
Waheed Barghouthi
|
|
|
|
|
copy ur content page html code and paste or check ur master page html code.
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
Thanks Pathan but in my content page i have no html code cause its all in master pages this what i have in my content page
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder2" runat="Server">
<asp:button id="Button1" runat="server" style="z-index: 100; left: 40px; position: absolute;
top: 80px" text="Button">
Waheed Barghouthi
|
|
|
|
|
Check if the ContentPlaceHolder control is inside the form tag. If not, put it inside the form. It should look like this:
<form id="form1" runat="server">
<!-- Html and ASP.NET markup -->
<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
<!-- Put controls here if desired -->
<asp:ContentPlaceHolder />
<!-- Html and ASP.NET markup -->
</form><pre>
|
|
|
|
|
hi,
i have a checkbox list, and having values like,
Company1
----------------
1 - car
2 - bus
3 - both
Company2
------------------
1 - car
2 - bus
3 - both
Company3
------------------
1 - car
2 - bus
3 - both
and these values are repeating for many Companies so my client can select Car or Bus or Both from a Company, but what if he/she selects Both then logically the Car or Bus Option should not be selectable, how i can achieve that.
I love .NET
|
|
|
|
|
if you have only these options then use radiobuttonlist instead of checkboxlist.
If you still want to use the checkbox then you have to write a javascript code for onclick and check which checkbox was clicked and uncheck all other checkboxes.
-----
|
|
|
|
|
You should take radioButton list insted of checkbox list.
If client select both there is no need to select car or bus.So u can achive this by radiobutton list
Best Regards
Pathan
GOD HELP THOSE WHO HELP THEMSELF
|
|
|
|
|
|
I want users to enter only character value into textbox for UserName. I dont allow users to enter any numeric value.
Please help me
|
|
|
|
|
use the onkeypress function and return false if character code does not fall in alphabets. You can get the code range by alert(event.keyCode()). key code is different for small and capital letters. I think they start from 64 to 92 but I am not sure you can alert them.
-----
|
|
|
|
|
Keep a RegularExpression Validator for your TextBox .
For Eg:Add the following line below your text Box in the source View.
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Enter Only characters" ControlToValidate="YourTextBoxID" ValidationExpression="^[\w]$" />
Koushik
|
|
|
|
|
I have three update panels with conditional updatemode. First paneld containt navigation buttons and dropdownlist for paging. Second panel contains sortable datagrid with and edit/view button in last column and triggers fired by the nagavtion buttons. The third panel contains a form to show the details on clicking the edit/view button in datagrid.
Most of the times all these are working fine. But some time onclicking the navigation buttons (first panel) the whole page flickers. Can someone tell me why?
Secondly whenever I edit any record by clicking on edit/view button, it shows me details fine. But right after that if I sort the grid, the whole page flickers instead of the second panel only. And it happens everytime I sort the grid after clicking on edit button. Second sort works fine?
Thanks in advance.
WELL: I just tested in firefox and it is working just fine in firefox. So I quess it is IE stupid stuff..
-- modified at 11:58 Monday 12th March, 2007
-----
|
|
|
|
|
My guess would be a) your using IE which has some horrible page flicker bugs in it and b) it occurs because most of the page is being updated (ie more than one panel), for smaller page updates you probably won't notice it. Does sorting the grid also update the third panel? I would of thought so...
|
|
|
|
|
I think your first guess might be true.
Your second is wrong because it is not updating all panels, it only updates the panel which I call panel.update or which have triggers. So updating is working fine only flickering of page is a problem that happens randomly. Most of the time it is working just as expected.
Thanx for your response.
WELL: I just tested in firefox and it is working just fine in firefox. So I quess it is IE stupid stuff..
-----
|
|
|
|
|
Hi
I downloaded the code of 'Switching Between HTTP and HTTPS Automatically '
from code project and trying to run it but it is giving me error
as
File or assembly name WebPageSecurity, or one of its dependencies, was not found.
in
<add name="SecureWebPage" type="Hyper.Web.Security.SecureWebPageModule, WebPageSecurity">
in web.config
If it is require a change in code,please let me know.
Swapnil Bhavsar
|
|
|
|
|
Hi
I have a simple asp.net page that contains link and open reports in pdf file on browser. I do have authentication to check user window log in for access to diff reports. But how do i avoid user to physically type in the path to view the report on browser?
Thanks
Nancy
|
|
|
|
|
i am using modalpopup control in ajax when panle pops up how to disable back page???
in my case it is enabled
|
|
|
|