|
I would suggest to keep your entity classes (generated from EF4) into database layer (separate C# class library). Don't keep them in models folder.
Your business layer methods should call them.
Your controller can call these business layer methods.
To use Entity class in your web project, add reference of your database layer.
This kind of architecture will give you a lot of flexibility in future.
|
|
|
|
|
Hello,
I am able to install multiple sites in http on the same server (using the http header).
unfortunatly i can't install it in https, I installed the certificate on port 443 for the first site then what must be done to the second site? Port 443 is used by the first site, Thanks for your help.
NB: I use IIS v6.0
|
|
|
|
|
guys, i have a problem that doesn't seem logical.
i have added this code to the Render() method of my new web control:
System.Web.UI.HtmlControls.HtmlGenericControl PreviewFrame = null;
if (!string.IsNullOrEmpty(this.PreviewFrameID))
{
PreviewFrame =(System.Web.UI.HtmlControls.HtmlGenericControl) this.NamingContainer.FindControl(this.PreviewFrameID);
if (btnSubmit == null) throw new HttpException("PreviewFrameID must point to an existing control on the page.");
PreviewFrame.Attributes.Add("name", PreviewFrame.UniqueID);
}
this code should add a name attribute to the Preview Frame to which i can target a response with type "image/jpeg".
<iframe id="PreviewFrame" runat="server"></iframe>
but amazingly, this doesn't work!!
Help people,so poeple can help you.
|
|
|
|
|
Ali Al Omairi(Abu AlHassan) wrote: target a response with type "image/jpeg".
What do you mean by this? You don't need a name attribute to identify an element, use the id. Most browsers will render the name attribute from the id attribute.
No comment
|
|
|
|
|
Sir;
I don't need to identify the element, actually I am trying to assign its name as a target of a form which I can respond its submission with an image/jpeg response. look the code below:
first i do the submission:
var iframe = setting.previewFrame;
var form = document.createElement('form');
form.method = 'post';
form.action = settings.action;
form.target = iframe.name;
then I build the response:
Response.ContentType = "image/jpeg";
Response.BinaryWrite(GetFileBytes());
Response.End();
using the iframe id wont work on FF or IE which are most used.
Help people,so poeple can help you.
modified 22-Jan-12 10:58am.
|
|
|
|
|
Well, this happens because method Render() occurs after the control is loaded what we should do is to move this code the the method OnLoad() like the code below:
protected override void OnLoad(EventArgs e)
{
System.Web.UI.HtmlControls.HtmlGenericControl PreviewFrame = null;
if (!string.IsNullOrEmpty(this.PreviewFrameID))
{
PreviewFrame = (System.Web.UI.HtmlControls.HtmlGenericControl)this.NamingContainer.FindControl(this.PreviewFrameID);
if (PreviewFrame != null)
if (string.IsNullOrEmpty(PreviewFrame.Attributes["name"]))
PreviewFrame.Attributes.Add("name", PreviewFrame.UniqueID);
}
}
Help people,so poeple can help you.
|
|
|
|
|
I have an asp.net for which the user fills. When the user clicks the submit button, the form is validated and also the database is checked if the entry with same fields is made. If the entry is already present then I need to pop up a confirmation box to confirm from the user if he wants to update the existing record.
Please let me know how to get the confirmation box on server button click after some instructions are processed in the code-behind page.
|
|
|
|
|
|
On a page I have and dymanicly generated ajax controls.
On Page_init
I created all dymanic controls however on asp:Button click event I can't find any of those dynamycly generated controls (FindControls not working). Could you tell me why?
myLiteralControl = New LiteralControl(" What type of student are you? ")
pnlQuestionnaire.Controls.Add(myLiteralControl)
Dim ddlDemographicTypes As New DropDownList
ddlDemographicTypes.ID = "ddlDemographicTypes"
pnlQuestionnaire.Controls.Add(ddlDemographicTypes)
Dim rfvDemographicTypes As New RequiredFieldValidator
rfvDemographicTypes.ID = "rfvDemographicTypes"
rfvDemographicTypes.Text = "* Required field"
rfvDemographicTypes.ControlToValidate = "ddlDemographicTypes"
pnlQuestionnaire.Controls.Add(rfvDemographicTypes)
Dim DemographicTypesCascadingDropDown As New CascadingDropDown
With DemographicTypesCascadingDropDown
.ID = "DemographicTypesCascadingDropDown"
.TargetControlID = "ddlDemographicTypes"
.Category = "DemographicTypes"
.PromptText = "< Please select>"
.ServicePath = "Service.asmx"
.UseContextKey = True
.ServiceMethod = "GetDemographicTypes"
.ContextKey = strGroupID
End With
pnlQuestionnaire.Controls.Add(DemographicTypesCascadingDropDown)
myLiteralControl = New LiteralControl("" & " ")
pnlQuestionnaire.Controls.Add(myLiteralControl)
End If
|
|
|
|
|
Dear All,
Please go through with my code. I do not understand why this is not working.I have searched alot and make this code.When i am checking my asms file in browser data is reflecting correctly in XML but when i am running in ASPX page nothing is happening.There is no error also
************.aspx page
my code here
webservice
[WebMethod]
public List<string> getAdmissionNo(string prefixText)
{
SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.AppSettings["MyCon"].ToString());
sqlConnection.Open();
SqlCommand sqlCommand = new SqlCommand("select Convert(varchar,AdmissionNo) As AdmissionNo from OA_ADM_tblAdmission_AdmissionDetails where AdmissionNo like @Name+'%'", sqlConnection);
sqlCommand.Parameters.AddWithValue("@Name", prefixText);
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCommand);
DataTable dt = new DataTable();
sqlDataAdapter.Fill(dt);
List<string> AdmissionNos=new List<string>();
for (int i = 0; i < dt.Rows.Count; i++)
{
string s =Convert.ToString(dt.Rows[i]["AdmissionNo"].ToString());
AdmissionNos.Add(s);
}
return AdmissionNos;
}
And aspx
<asp:ScriptManager runat="server" ID="sm"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtAdmisssionNo" runat="server" MaxLength="15"></asp:TextBox>
<asp:AutoCompleteExtender ID="autoCompleteExtender" runat="server" TargetControlID="txtAdmisssionNo"
MinimumPrefixLength="1" ServiceMethod="getAdmissionNo" ServicePath="~/Service.asmx" >
</asp:AutoCompleteExtender>
</ContentTemplate>
</asp:UpdatePanel>
correct records
121010001/002
121020001/003
121020002/002
121010002/001
111020002/001
111020001/003
111010001/001
but our Autocomplete result displays this format
60505000.5
40340000.333333336
60510001
121010002
111020002
37006667
111010001
it was wrong.i want 121010001/002 this format records help me.
|
|
|
|
|
its nothing
just
AdmissionNos.Add("\"" + dr["AdmissionNo"].ToString() + "\""); .
problem solved
|
|
|
|
|
can i call method (not from code behind) to set attribute of server control?
in fact i need DataBind - like markup without DataBinding
just like
<asp:Repeater runat="server" ID="rpt" DataSourceID="dsID">
<ItemTemplate>
<%#Eval("something")%>
</ItemTemplate>
</asp:Repeater>
i need something like this
public string Hello()
{
return "hello";
}
<asp:Label ID="Label1" runat="server" Text='<%#Hello() %>' />
|
|
|
|
|
hi all,
Please, help me good and professional CSS for GRIDVIEW in ASP.NET.
Thanks in advance.
Regards,
ssnsol
|
|
|
|
|
Hi all,
Wish you a happy and prosperous new year 2012.
I am saravan kumar.
I am developing ASP.NET application on inventory and production managment system using ASP.NET, MS-SQL SERVER 2008 and Framework 3.5.
I had created virtual directory in IIS 6.0 to ASP.NET application in server system.
Problem number 1:
I am not able to access virtual directory using "http://localhost/virtual directory/" in server system itself. But, login page does not establish connection with MS-SQL SERVER 2008.
Problem number 2:
I am not able to access virtual directory in LAN from other nodes. (only one LAN with 5 nodes).
Please, help me at the earliest.
Thanks in advance.
Regards,
Saravan Kumar.S
|
|
|
|
|
hi,
i have concatenate following strings 1123456,/,009 using
list<string> .but it was displayed in
124828 that is divide the value in 009 i want 1123456/009 this format for using autocomplete textbox using webservice asmx.pls help me
modified 20-Jan-12 3:44am.
|
|
|
|
|
hi,
You can concatenate both.
Eg. List<string> samplevalues = new List<string>;
samplevalues.Add(0,"0000233");
samplevalues.Add(1,"009");
string result = string.Empty;
result = samplevalues[0].ToString() + "/" + samplevalues[1].ToString();
Regards,
ssnsol.
|
|
|
|
|
Test.aspx is contained to master page.
ans Test.aspx page create sub menu by using jquery.
I want to maintain scroll when i click submenu which url is also Test.aspx.
So if i click click submenu , page move to Test.aspx.
Amd I want to maintain scroll.
So I insert below code to masterpage and Test.aspx page.
maintainScrollPositionOnPostBack="true"
But it does't work...
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|
|
hi,
In asp.net3.5 autocomplete textbox using webservices display problem. that is the autocomplete actual records are 121010001/002,121020001/003. but its display in 60505000.5,40340000.333333336 this format. pls correct that help me.
Shanthi
|
|
|
|
|
i think it is displaying division ,You can convert this vales into varchar in the sql script
|
|
|
|
|
hi,
its correct. but converted into varchar again display the double values.
|
|
|
|
|
Hi,
Try this.
While selecting records from backend. Use
convert(varchar,field1)
Regards,
ssnsol.
|
|
|
|
|
Is there any good blog software that I can use on my asp.net website?
|
|
|
|
|
|
|
Hi All,
I just want to get your opinion on what is the best approach in my gridview.
Sample Gridview Data.
--------------------------------------------------------------------
| | UserID | First Name | Last Name | Last Loggedin|
--------------------------------------------------------------------
|imgBtn | PHUserId1 | Jim | Carey | 1/16/2011 6:00AM |
--------------------------------------------------------------------
--------------------------------------------------------------------
|imgBtn | PHUserId2 | Andres | Boni | 1/27/2011 5:56 PM |
--------------------------------------------------------------------
--------------------------------------------------------------------
|imgBtn | PHUserId3 | George | Jungle | 1/2/2011 4:01 AM |
--------------------------------------------------------------------
What i want to do is, in the 1st column of the GridView(grdUserList) control once i click the ImageButton control inside ItemTemplate of the gridview a popup(Ajax PopupExtender)
will appear. The popup contains GridView (grdHistory) control inside of it which are the logged history of the user you select.
Actually, the design and the output is already done. I get a popup everytime i click the ImageButton on the 1st column of the GridView(grdUserList) control.
But the problem now is, how do i refresh the GridView(grdHistory) control in my popup everytime i select different user in my GridView(grdUserlist).
I place Click event on the ImageButton but it fires only once. The next click on the ImageButton will no longer fires the Click event.
I dont what to used the Ajax ModalPopupExtender for the reason of, i dont what the user to close a popup evertime they click the ImageButton in the 1st row.
Thanks in advance
if(you type your code here) {
Messagebox.Show("You help me a lot!");
}
else {
You help me = null;
}
|
|
|
|