|
When you drag the server authentication controls on to your page for the first time Visual Studio creates all the tables and the database.
The database exists within the web application.
I have code that connects to SQL server 2005 tables and I have connection stings for that.
However in the book I am reading, it says if I want to use SQL server instead of SQL Express for authentication, I need to modify the web.config file and clear out all the existing connection strings and replace it with
<add name="LocalSQLServer" providername="System.Data.Sqlclient"
connectionstring="Data source=localhost;integrated security=SSPI;
AttachDBFilename=|Datadiretory|aspnetdb.mdf;user intance=true">
My problem is I have other connection strings that I use for my website that I still need.
Does this make sense?
|
|
|
|
|
|
Well, you wouldn't replace it with localhost, unless that was where your DB was. I imagine you need to copy the tables in question to your SQL Server DB, then just point everything to the connection string you're currently using.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Textbox in the edit template is not binding... The Masked edit extender causes the error "Line: 16
Error: '2.length' is null or not an object". Well I actually have two textboxes closing time and opening time... Opening time always causes this error while closing time is working fine in edit mode....I tried to redo the whole thing and maybe it might work but it didn't, tried to check everything from syntax to binding of textbox everything looks fine...Anybody who knows what its complaining about....Heres the edit template not workin maybe there's a bug somewhere....
<edititemtemplate>
<asp:textbox id="timOpeningTime_edt" runat="server" text="<%# Bind("timOpeningTime") %>" columns="5" validationgroup="MKE">
<asp:requiredfieldvalidator id="rfvOpeningTime_edt" runat="server" text="*" errormessage="Opening Time is required!" controltovalidate="timOpeningTime_edt" validationgroup="EditGrid">
<asp:regularexpressionvalidator id="rgxOpeningTime_edt" runat="server" controltovalidate="timOpeningTime_edt"
="" display="Dynamic" errormessage="Invalid Time format! Must be like 99:99 for 00:00 to 23:59" setfocusonerror="True" validationexpression="^(20|21|22|23|[01]\d|\d)(([:][0-5]\d){1,2})$" validationgroup="EditGrid">*
<cc1:maskededitextender id="MaskedEditExtender5" runat="server"
="" targetcontrolid="timOpeningTime_edt" mask="99:99" messagevalidatortip="true" onfocuscssclass="MaskedEditFocus" oninvalidcssclass="MaskedEditError" masktype="Time" acceptampm="false" usertimeformat="TwentyFourHour" errortooltipenabled="True">
<cc1:maskededitvalidator id="MaskedEditValidator5" runat="server"
="" controlextender="MaskedEditExtender5" controltovalidate="timOpeningTime_edt" isvalidempty="False" emptyvaluemessage="Time is required in the format: 99:99" invalidvaluemessage="Time is invalid" display="Dynamic" tooltipmessage="Input a time" emptyvalueblurredtext="*" invalidvalueblurredmessage="*" validationgroup="MKE">
|
|
|
|
|
There is no length property in any of the code you posted.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Exactly I don't have length property, don't know where the error get thats....The 2.length thing is the AJAX script that controls the maskededit in the background...
modified on Tuesday, August 18, 2009 8:55 AM
|
|
|
|
|
Hi,
Is there any big reason of why should I use the "ASP.NET MVC" (built-in mvc) instead of implementing the pattern itself manually ??
|
|
|
|
|
Trendiness and resume food are the only things I can think of.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I think you answered the question already, should you use something that is available or build your own.
only two letters away from being an asset
|
|
|
|
|
But is it possible to implement it without any troubles?
Because of the pages throwing events and catching events maybe...
Also I didnt found much information on google about doing it manually
|
|
|
|
|
I am not well versed in ASP.NET so how to do this is really escaping me.
I want to display the value of one of the properties from an object conained in an arraylist using c#
This is kind of what I mean but, of course, this doesn't work
string mystr = myArrayList[0].strValue;
myArraylist[0] cantains an object with property strValue. I know I can't use the [] in the expression but how do I access that property?
The help is much appreciated.
|
|
|
|
|
This has nothing to do with ASP.NET.
Your problem is that you're using an arraylist, which is not strongly typed. In future, I suggest you define 'doesn't work', so people can help you better, but in this case, I know it 'doesn't work' because you're not casting the object. Use a List instead, never use the non generic collections.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You're scolding me for using outdated code right?
I inherited this code with an arraylist. Maybe I should switch it over, but I did resolve my problem with the arraylist once I figured out my way around a foreach
foreach ( object myobj in myArray)
{
mystringbuilder.Append( myobj.myproperty);
}
Anyway, thanks for the reply
|
|
|
|
|
how to integrate the following pseudo-class into ASP.net
<style>
a:link {color: blue;} /* an unvisited link */
a:visited {color: purple;} /* a visited link */
a:hover {color: red;} /* a link with the mouse hovering
over it */
a:active {color: green;} /* the selected link */
</style>
because I want to realize the mousehover ona linkbutton to change the color,
but I do not know how to use the css style, for self-defined css style, we can sue sth like
<div class="style_deine_1" >
thanks!
|
|
|
|
|
Use MouseOver and MouseOut for Change the color of hover. And For Rest, only using the CSS Class.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thanks, again, but I did not understand you.
here, I also want to know that is it possible to use these css styles in ASP.net, if so, how?
|
|
|
|
|
Ohh. I missunderstood yout question. You do it like this way,
.MyHperLink{
font-family: Verdana;
font-size: 11px;
color: #006DB1;
}
.MyHperLink:a
{
color: #006DB1;
text-decoration:none;
}
.MyHperLink:hover
{
color: #13B12D;
text-decoration:underline;
}
Do all other stuff for active etc.
Set CssClass="MyHperLink" for link button.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thanks a lot.
I tried, it seems that css does not work for linkbutton, no idea why.
but it does work for others such as BulletedList.
|
|
|
|
|
it is strange that I can not find function to set the color for a linkbutton when mouseover,
it should be a normal function, but...
e.g. anyone can give me one hint?
e.g.
asp:LinkButton ID="LinkButton6" Font-Underline="false" ForeColor="White" BackColor="Green" Font-Size="Medium"
Font-Bold="false" Font-Names="Arial" runat="server" BorderStyle="Double"
BorderColor="Silver"> Download Statistics</asp:LinkButton>
|
|
|
|
|
use OnmouseOver and call a javascript method to change the style
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
it does not work, because I use ASP.net linkbutton, the ID can not be found by javascript function by using GetElementByID,I do not know why.
|
|
|
|
|
Seraph_summer wrote: it does not work,
It should work
Seraph_summer wrote: because I use ASP.net linkbutton, the ID can not be found by javascript function by using GetElementByID,
Seraph_summer wrote: I do not know why.
Because, your LinkButton is Server Side Control . So, for that you need to first get ClientID then need use getElementByID.
var LinkClientID="<%=mylinkbutton.ClientID%>";
var NewID=document.getElementByID(LinkClientID);
Now use NewID for all operation,
Please check syntax once
Hope this will helpful to you.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thanks, I see, ASP.net and old technology is different, the mixed appliacitons with these
technologies make me a little confused.
one more quetion, as I just put one new question, is it possible to use CSS style to realize this function?
thank you for your help all the time!
|
|
|
|
|
Welcome. Dont forget to mark post helpful if its really help you. This lets us know which answers are good in forum !
Thank You !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
sorry, again, after I get the id of the linkbutton (as follows), then how to change the backcolor of the button
I do not know which function can be used.
function LinkBtnMouseOver() {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
}
|
|
|
|