|
Do not cross-post!!!
1: To succeed: you have 2 ears and one mouth. Keep your ears open and your mouth closed and you'll go far.
2: Read 1 again and follow the instruction.
3: Read and understand the requirement.
4: You're already there.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Here's the best tip you'll ever get about starting a new job...
Forget everything you learned in college. You are in the real world now.
I think you will find that the work environment will shock you at first. DON'T cause trouble - you are there to learn everything you didn't learn in college, which is, well, everything. So, keep in mind, when you see something that feels wrong, don't point out that it's wrong, try to figure out why it's right in the real world, and what were the lies they told you in college to make it sound right in the classroom.
|
|
|
|
|
I have a couple of placeholders in a form to hide / show fields depending on a boolean. My form controls are all laid out like the following, each contol is on it's own line and when output as html (afaik) should still be on it's own line.
<p><asp:label ID="lblSchool" AssociatedControlID="School" runat="server">School (if applicable):</asp:label>
<asp:TextBox id="School" runat="server" MaxLength="50" />
<asp:RequiredFieldValidator ID="reqSchool" runat="server" ControlToValidate="School" Display="Dynamic" CssClass="val-error" Text="* required" SetFocusOnError="true" />
<bcg:NoPunctuationValidator ID="validSchool" runat="server" ControlToValidate="School" Display="Dynamic" MaxLength="101" CssClass="val-error" Text="* invalid" SetFocusOnError="true" /></p>
I have found however when the controls in the placeholder are rendered they all squashed up with no whitespace in betweeen them. It seems the placeholder is removing the whitespace.
Is there any way to stop this.
modified 24-Apr-13 11:07am.
|
|
|
|
|
It's not the placeholder - in HTML, any sequence of whitespace characters (including line-breaks) is usually treated as a single space.
http://www-sul.stanford.edu/tools/tutorials/html2.0/whitespace.html[^]
If you want each control to render on a new line, you'll need to insert an HTML line-break between the lines:
Line 1<br />
Line 2<br />
Line 3
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sorry I haven't explained what I mean properly.
I don't want the controls to render on a new line. I would like the whitespace kept in the html output so it gives that single space. I've added the html below to better explain. This is what the controls in the placeholder output like, no whitespace between them even though there is whitespace / line breaks in the ASCX files as shown in my original post.
<p><label for="ContentPlaceHolderDefault_MainContent_MainContent_ContactForm_18_School" id="ContentPlaceHolderDefault_MainContent_MainContent_ContactForm_18_lblSchool">School (if applicable):</label><input name="ctl00$ctl00$ctl00$ctl00$ContentPlaceHolderDefault$MainContent$MainContent$ContactForm_18$School" type="text" maxlength="50" id="ContentPlaceHolderDefault_MainContent_MainContent_ContactForm_18_School" /><span id="ContentPlaceHolderDefault_MainContent_MainContent_ContactForm_18_reqSchool" class="val-error" style="display:none;">* required</span><span id="ContentPlaceHolderDefault_MainContent_MainContent_ContactForm_18_validSchool" class="val-error" style="display:none;">* invalid</span></p>
|
|
|
|
|
The markup below is the html encoding for a space char, you can use those to create sort of a shim in between things.
" "
Well, I having trouble with getting it to show, as you can see, it's invisible.
& nbsp;
Take the space out between the ampersand and the n
[edit]
Now I'm confused, you don't want the space now, perhaps because you placed the span tags or labels inside the p element, all the controls may be justified in alignment, creating spaces in between.
So replace the p element with the div element, so they display inline.
modified 24-Apr-13 22:44pm.
|
|
|
|
|
Hi,
I have written java script for pop up to come when image button in clicked and record to be saved,
the following is the html code,but validations are not working when i click
image button to save,how can i activate the validations when image button is clicked
<asp:imagebutton id="imgSave" validationgroup="SaveValidation"
="" runat="server" onclientclick="return SaveConfirm();" imageurl="~/Images/Buttons/save.png" onclick="imgSave_Click">
|
|
|
|
|
You haven't provided the brackets on the OnClick=
OnClick="imgSave_Click()"
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
You don't need brackets on the server event handler assignment.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
> "You don't need brackets on the server event handler assignment."
ok, didn't know that.
I've only just got round to bothering with all this .Net ASP lark. Looks like some old assumptions need to be dropped.
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan
That's what machines are for.
Got a problem?
Sleep on it.
|
|
|
|
|
hihi Richard Deeming thx u help me on image handler on 1 Feb '13 - 20:17 thx u
|
|
|
|
|
when i am keeping brackets for onClick="imgSave_Click()", i am getting error that is, No overload for method 'imgSave_Click' takes '0' arguments
|
|
|
|
|
At the moment, the client-side click attribute is being rendered as something similar to:
return SaveConfirm(); DoTheValidation()
None of the code after the return statement will execute, which is why the validation isn't firing.
Try changing the code to:
OnClientClick="if(!SaveConfirm()){return false;}"
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I want append Gridview using threading in asp.net
actually i want to do something like bind GridView from code behind using multi thread something like in social networking sites few content appears and remaining also keep appending
like: when we login into any social networking site the output result comes with few content and remaining content continues to append
|
|
|
|
|
MultiThreading would be the wrong approach for this because the Threads would execute on the server and prevent your page from being sent to the client. You'd need to use JavaScript which is accessing a web service and retrieve the data that way.
|
|
|
|
|
I am trying to encrypt a password in asp.net.
I have a VB code that does the same.
Please tell me a asp.net equivalent of the following code
Dim processPwd = New ProcessPassword()
Dim encryptedPwd = String.Empty
encryptedPwd = processPwd.EncryptPassword(TxtPassword.Text)
Note- my server only accepts the encryption done by the above way, so please suggest accordingly.
Thanks
|
|
|
|
|
maverick12131 wrote: Please tell me a asp.net equivalent of the following code
ASP.NET is not a language. You have a VB code which should be very well valid for a ASP.NET code behind. Use it.
If you are looking for C#:
ProcessPassword processPwd = new ProcessPassword();
string encryptedPwd = string.Empty;
encryptedPwd = processPwd.EncryptPassword(TxtPassword.Text);
|
|
|
|
|
In addition to sandip's answer you can also convert your code from vb to c# or vice verse.
Conversion tool from C# <--> VB[^]
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
ASP.Net is a web technology, primarly using serverside code in C# and client side JavaScript.
You can simply convert the piece of code to C# code.
ProcessPassword processPwd = New ProcessPassword();
String encryptedPwd = String.Empty;
encryptedPwd = processPwd.EncryptPassword(TxtPassword.Text);
|
|
|
|
|
Who can help me on expression i want the format must be 20.00 must .00 at the back , what i should add in with my expression?
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="RegularExpressionValidator"
ValidationExpression="^\s*\$?\s*\d{1,3}((,\d{3})*|\d*)(\.\d{2})?\s*$">*</asp:RegularExpressionValidator>
this expression only can check first digit cant be .
only allow digit, and cant check after . must be 2digit at the back for example 20.00
|
|
|
|
|
Hi,
I am not sure about the Regular expression but have couple of other solutions.
1) if you need to store decimal point in the database then that can be done through c# code as well.
decimal.Round(yourValue, 2, MidpointRounding.AwayFromZero);
2) Another way is to create javascript on the lost focus of your textbox. in the javascript function you can check for the decimal point if it is not exist then you can append that in the text box.
Hope this information may lead you to some work around.
Best luck
Thanks
-Amit Gajjar (MinterProject)
|
|
|
|
|
Try it this way:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="RegularExpressionValidator"
ValidationExpression="^\$?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$">*</asp:RegularExpressionValidator>
He who goes for revenge must first dig two graves.
|
|
|
|
|
Hi,
i have a doubt about how to display a grid view in ASP.NET from SQL server 2012 according to the instruction given by drop down list from multiple tables. For example say, I have created 2 tables Members and Item where Member.Mid=Item.Mid set as primary and foreign key. okay, now my question is how should write or set code for to display according to the value selected from dropdown list in one gridview.
Once again, I want display in one gridview from multiple tables according to the value from dropdownlist...
I am using C# in VS2012 and SQLserver 2012.
Thank you in advance...
S.Thomas.
S.Thomas
|
|
|
|
|
Use a stored procedure which gives you the results back.
To merge the results from multiple tables in a SQL query, you need to use joins[^].
There are furthermore different types of joins:
-inner join[^]
-left join[^]
-right join[^]
-full join[^]
|
|
|
|
|
Hi All,
I want to connect to a SQL Server database saved on URL
database name fc000xststsql01.IVRCallCenterTest
server address http://ma001xsicmw91/IVRControllerAppProd/Home/
what would be the connection string I will use in web config file ?
Thanks
|
|
|
|