|
What exactly did you mean by overriding the dataBind()?
|
|
|
|
|
|
hi all ,
this my codebehind on login button click
FormsAuthentication.Initialize(); FormsAuthenticationTicket ObjTicket = new FormsAuthenticationTicket(1, txtLoginId.Text, DateTime.Now, DateTime.Now.AddMinutes(60), false, txtLoginId.Text + "," + txtPassword.Text, FormsAuthentication.FormsCookiePath); string encTicket = FormsAuthentication.Encrypt(ObjTicket); string sLoginId = txtLoginId.Text; sLoginId = sLoginId.Replace(" ", ""); Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket)); Response.Redirect(FormsAuthentication.GetRedirectUrl(txtLoginId.Text, false)+"?id="+txtLoginId.Text);
and this is web config code
<authentication mode="Forms"> <forms defaultUrl="~/PresentationLayer/Forms/Main.aspx" loginUrl="~/Default.aspx" > </forms> </authentication>
above code well working on local host .......but on live host
"~/" append with url
for example i want
www.abc.com/abc/PresentationLayer/Forms/Main.aspx
but i get
www.abc.com/abc/~/PresentationLayer/Forms/Main.aspx
can anybody tell me that where is problem
|
|
|
|
|
zeeShan anSari wrote: forms defaultUrl="~/PresentationLayer/Forms/Main.aspx"
Check whether replacing ~/PresentationLayer/forms with PresetationLayer/forms does cure ....
|
|
|
|
|
it does not working.
and bellow message show on page
Server Error in '/exxnew' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /exxnew/~/PresentationLayer/Forms/Main.aspx
now i use
Response.Redirect("/PresentationLayer/Forms/Main.aspx",false);
it's work well on local host but on live host its append /~
|
|
|
|
|
AFAIK ASP.NET does not translate ~ into your root web application path when used within the defaultUrl attribute.
You can most likely be able to replace it with /exxnew/PresentationLayer/Forms/Main.aspx (where /exxnew denotes your prod website's virtual root path)
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
hi all,
i am posting some url to server through http request which returns result in updatepanel control so it requires me to add "x-microsoftajax: Delta=true
header, but it returns me error code 400...
but if i remove this header i get the page but without that updatepanel which contains the required data for me....please can anyone assist me on this.
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
Are you using XmlHttpRequest for this??
I think what asp.NET does... from within the updatepanel.. if a request is made. the postback is suppressed and AJAX page creates an XMLHttpRequest object and places the special request with x-microsoft: Delta=true and receives only the part of data which corresponds to the update panel..
This is purely an AJAX request and the output you get from those request will not hold the entire page. If are putting your custom request by making an object of XMLHttpRequest yourself, you need to know what are the other things that the request must contain before this could get an output. This is purely a custom request made by Microsoft. 400 means bad request or Page doesnt exists...
Thus rather than making this type of request, it is always better to expose the data in one page and make a call normally to it. Tweaking between custom forms and viewstate entries is not always good... (At least who knows this internal form structure might change in next version of UpdatePanel )
|
|
|
|
|
Hi Abhishek,
Thanks for the reply..
but what about it "but if i remove this header(x-microsoftajax: Delta=true ) i get the page but without that updatepanel which contains the required data for me....."
Yes i am using HTTPRequest object.
so as you said i should try to send httprequest without view source and other stuff but can you explain it a bit more that what i should exactly do.
Thanks A Ton
Ash_VCPP
walking over water is just knowing where the stones are.....
|
|
|
|
|
|
This really isn't related to ASP.NET, it would probably be more appropriate in the C# or .NET Framework forums.
However, you can try something like this
baContact.BusinesTypeReference.EntityKey = new System.Data.EntityKey("Entities.BusinessType", "ID", businessTypeID);
only two letters away from being an asset
|
|
|
|
|
Thanks, I'll try that. I think most people using the entity framework are doing some form of ASP.net, so I figured this would give the best chance of getting answer. Thanks for the reply.
I didn't get any requirements for the signature
|
|
|
|
|
I tried the above and it said object reference not set to an instance of an object
Edit I think it was because the baContact is null. It hasn't been inserted into the database yet.
I didn't get any requirements for the signature
|
|
|
|
|
SqlData.BusinessAssociateContactChangeRequest baContact = new BusinessAssociateWorkFlow.SqlData.BusinessAssociateContactChangeRequest();
How can baContact be null? It doesn't matter if it inserting into the database or not at this point.
only two letters away from being an asset
|
|
|
|
|
I'm not sure. The error was object reference not set to an instance. I don't what else it could have been.
I didn't get any requirements for the signature
|
|
|
|
|
I was able to get my code to work with the following, but it seems inefficient.
<br />
int baRequestTypeId = int.Parse(this.rblMode.SelectedValue);<br />
int baAssociateTypeId = int.Parse(this.rcbAssociateType.SelectedValue);<br />
int baBusinessTypeId = int.Parse(this.rcbBusinessType.SelectedValue);<br />
<br />
<br />
<br />
SqlData.BusinessAssociateWorkFlowData dataContext = new BusinessAssociateWorkFlow.SqlData.BusinessAssociateWorkFlowData();<br />
SqlData.BusinessAssociateContactChangeRequest baContact = new BusinessAssociateWorkFlow.SqlData.BusinessAssociateContactChangeRequest();<br />
<br />
SqlData.RequestType baRequestType = (from r in dataContext.RequestType<br />
where r.RequestTypeId == baRequestTypeId<br />
select r).First();<br />
<br />
SqlData.BusinessAssociateType baBusinessAssociateType = (from b in dataContext.BusinessAssociateType <br />
where b.BusinessAssociateTypeId == baAssociateTypeId<br />
select b).First();<br />
<br />
<br />
SqlData.BusinessType baBusinessType = (from b in dataContext.BusinessType<br />
where b.BusinessTypeId == baBusinessTypeId<br />
select b).First();<br />
baContact.RequestType = baRequestType;<br />
baContact.BusinessAssociateType = baBusinessAssociateType;<br />
baContact.BusinessType = baBusinessType;<br />
baContact.Name = this.rtbName.Text;<br />
baContact.Abbreviation = this.rtbAbbreviation.Text;<br />
baContact.Code = this.rtbCode.Text;<br />
baContact.CreatedBy = User.Identity.Name;<br />
baContact.CreatedOn = DateTime.Now;<br />
baContact.LastModifiedBy = User.Identity.Name;<br />
baContact.LastModifiedOn = DateTime.Now;<br />
baContact.ContactAddress.Add(this.AddressCntrl1.GetContactAddressEntity(ref dataContext));<br />
dataContext.SaveChanges();<br />
<br />
I didn't get any requirements for the signature
|
|
|
|
|
Todd,
I didn't see your original question as it has been deleted.
However, if I got this right you don't need to requery baRequestType, baBusinessAssociateType and baBusinessType.
Your baContact should contain the property xxxxReference (where xxxx stands for the foreign key class), e.g. requestTypeReference.
Instead of requerying all the types you can simply create an entity key and assign it to the xxxxReference.EntityKey property.
Example:
baContact.RequestTypeReference.EntityKey = new EntityKey("YourDataSetNamespace.YourDataSetName", "YourPKPropertyName", yourValue);
Cheers,
Ed
|
|
|
|
|
Your answer does seem to be the correct solution. Thank you.
I don't know if I like it though. I don't understand why a table column value can't be set as a property just because there is a foreign key on it.
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
I have 2 dropdownlists on a page. (DDL1 and DDL2). The DDL1 is populated by values from the database using a SqlDataSource(SDC1). DDL2 is dependent on DDL1. As soon as a value is selected in DDL1 I need to populate values in DDL2, though using SqlDataSource SDC2 which is also available on the page.
SDC2 is defined with correct select sqls and where clause parameters during design time but I need to know how I can populate DDL2 only after a value is selected in DDL1. This might sound as a redundant question though I never found a post that will help me achieve this using SDC.
Thanks for your help in advance.
|
|
|
|
|
|
Hello Friends,
I've a GridView inside a UpdatePanel. And there is a Fileupload control inside the GridView which is fired to Update the existing image with newer one. My code is running perfectly without UpdatePanel. But as i put my GridView inside the UpdatePanel it gives me an error "Object References not set to an instance". I think this error is being generated because of FileUpload control. So i want to have a trigger control of UpdatePanel to upload the new image. How can i bind a trigger control of UpdatePanel at RowUpdating event of GridView at code behind
|
|
|
|
|
If you have to refresh the grid when file upload occurs why do you place the GridView inside the update panel???
You can use PostBack trigger to upload files..
Check this[^] how they are doing fileupload from within the updatepanel using PostBack Trigger.
|
|
|
|
|
I dont have to refresh the page. I just want to use PostBack trigger. But PostBack trigger needs a ControlID so what will be the ControlID for PostBack Trigger. Because i'm using RowUpdating event of GridView......
|
|
|
|
|
AFAIK... Postback trigger will used to postback the whole page to the server...
The controlId of the PostBack trigger should be the control that should invoke the Postback from within the UpdatePanel.
If you want Button1 which is placed within the UpdatePanel to postback the page, rather than going for partial update, just use ControlID = "Button1" For your help, lets give you a sample code :
<asp:UpdatePanel ID="upTest" ChildrenAsTriggers="False" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Label ID="lblResults" runat="server"></asp:Label><br /><br />
<asp:Button ID="btnAsync" Text="Asynch Post" runat="server" OnClick="btnAsync_Click" />
<asp:Button ID="btnFullPost" Text="Full Post" runat="server" OnClick="btnFullPost_Click" >
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnAsync" EventName="Click" />
<asp:PostBackTrigger ControlID="btnFullPost" />
</Triggers>
</asp:UpdatePanel>
AsyncPostBackTrigger will postback asynchronously while PostBackTrigger will do this normally...
|
|
|
|
|
I have the same problem can you take a look:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ctrlUserProfilePics.ascx.cs"
Inherits="OmegaLove.Web.UI.ctrlUserProfilePics" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%--<%@ Register Src="ctrlGPStatusBox.ascx" TagName="ctrlGPStatusBox" TagPrefix="uc1" %>
--%>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<br />
<div id="UploadArea">
<table>
<tr>
<td>
Browse Image:
</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
</tr>
</table>
</div>
<p>
<asp:Button ID="UploadButton" runat="server" Text="Upload Now" OnClick="UploadButton_Click" />
</p>
<asp:Label ID="lblResult" runat="server" ForeColor="#0066FF"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="UploadButton" />
</Triggers>
</asp:UpdatePanel>
<br />
<hr />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="5"
GridLines="None" ShowHeader="False">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="imgSaved" runat="server" ImageUrl='<%# imageURL(DataBinder.Eval(Container.DataItem, "img_id").ToString()) %>'
AlternateText='<%#DataBinder.Eval(Container.DataItem,"img_title") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
No records found
</EmptyDataTemplate>
</asp:GridView>
|
|
|
|