modify Visible function in repeater of gridview control
Problem:
display label with the text full if the current field equal to zero in repeater or gridview
Solution:
<asp:Label ID=”Label1″ runat=”server” Text=”Full” ForeColor=”Red” Visible=’<%# Convert.ToBoolean(Eval(“name of your field”).ToString().Equals(“0″)? “true”:”false”) %>’>
No comments yet.
No trackbacks yet.
List of SendKeys
about 5 months ago - No comments
Key
Code
BACKSPACE
{BACKSPACE}, {BS}, or {BKSP}
BREAK
{BREAK}
CAPS LOCK
{CAPSLOCK}
DEL or DELETE
{DELETE} or {DEL}
DOWN ARROW
{DOWN}
END
{END}
ENTER
{ENTER}or ~
ESC
{ESC}
HELP
{HELP}
HOME
{HOME}
INS or INSERT
{INSERT} or {INS}
LEFT ARROW
{LEFT}
NUM LOCK
{NUMLOCK}
PAGE DOWN
{PGDN}
PAGE UP
{PGUP}
PRINT SCREEN
{PRTSC} (reserved for future use)
RIGHT ARROW
{RIGHT}
SCROLL LOCK
{SCROLLLOCK}
TAB
{TAB}
UP ARROW
{UP}
F1
{F1}
F2
{F2}
F3
{F3}
F4
{F4}
F5
{F5}
F6
{F6}
F7
{F7}
F8
{F8}
F9
{F9}
F10
{F10}
F11
{F11}
F12
{F12}
F13
{F13}
F14
{F14}
F15
{F15}
F16
{F16}
Keypad add
{ADD}
Keypad subtract
{SUBTRACT}
Keypad multiply
{MULTIPLY}
Keypad divide
{DIVIDE}
Key
Code
SHIFT
+
CTRL
^
ALT
%
Finding Duplicates with SQL
about 8 months ago - No comments
problem:finding the duplicate within sql
solution:provide table named subscriber, with elements: email
SELECT COUNT(DISTINCT email) AS NumberOfEmail, email FROM subscriber GROUP BY email HAVING (COUNT(email) > 1)
select NOT in top post sql query
about 8 months ago - No comments
problem:make some selection in database OTHER THEN top (10) post
solution: provide, table named news with element: newsID, newsDate
SELECT * FROM News WHERE (newsID NOT IN (SELECT TOP (10) newsID FROM News AS News_1 ORDER BY newsDate DESC)) ORDER BY newsDate DESC
it will return all post except top 10 post
type of requesturl aspx
about 11 months ago - No comments
Request.Url.Host = asp.net.do
Request.Url.ToString = http://asp.net.do/test/requesturl.aspx
Request.ApplicationPath.ToString = /test
Request.RawUrl.ToString = /test/requesturl.aspx
Page.TemplateSourceDirectory = /test
Request.Url.AbsoluteUri = http://asp.net.do/test/requesturl.aspx
Taken from : http://asp.net.do/test/requesturl.aspx
calculating age in sql
about 11 months ago - No comments
problem:
display age with sql command
solution:
sql command:
SELECT DATEDIFF(mm, dateOfBirth, GETDATE()) / 12 AS age
FROM someTable
it wil display age ^^V
birthday reminder list asp.net
about 12 months ago - No comments
problem:
displaying list of bday boy/girl in next (30/ according to your own choice ) days from the current date.
solution:
im using the sql to select the date of birth, for displaying, you can use whatever you want, like gridview, datalist etc.
hereby the sql command:
SELECT DateOfBirth
FROM someTablename
WHERE (DateOfBirth < GETDATE()) AND (DATEDIFF(d, GETDATE(), DATEADD(yy, DATEDIFF(yy, DateOfBirth, GETDATE()), More >
embedding flash in server control
about 1 year ago - No comments
Problem:
When you got your website (aspx website), especially when you already put url rewriting, you want to embed flash ( doesnt matter if its swf or flv)
You need to have relative path, starting with ("~/" ) in the url.
Solution:
you can put the code in your server control, so it will be easier to integrate
FlashPlayer.ascx
<object More >
Repeater inside repeater asp net
about 1 year ago - No comments
Problem :
Putting repeater inside repeater and take ID of parent repeater to bind the datasourse.
Solution:
hereby the example of code:
in .aspx
<asp:Repeater ID="Repeater2" runat="server"
onitemdatabound="Repeater2_ItemDataBound">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("Tag") %>'></asp:Label></asp:HyperLink>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
(<asp:Label ID="CountID" runat="server" Text='<%# Eval("Expr1") %>'></asp:Label>)
</ItemTemplate>
</asp:Repeater>
<br />
</ItemTemplate>
</asp:Repeater>
in .aspx cs
private DataTable getDataTableforRepeater2(int TagID)
{
More >
SELECT next, last row or “LIMIT-command” in MSSQL
about 1 year ago - No comments
SELECT previous row or "LIMIT-command" in MSSQL
SELECT TOP (1) FROM table_name WHERE (ID< @ID)
ORDER BY ID DESC
SELECT next row or "LIMIT-command" in MSSQL
SELECT TOP (1) FROM table_name WHERE (ID> @ID)
ORDER BY ID
Thank also for the descussion
disable remove viewstate aspx
about 1 year ago - No comments
Problem:
Annoying LONG viewstate
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEyMjcx
NDEzNzQPZBYCZg9kFgQCAQ9kFgICAg8VAh4vV29ybGRHcmFubnkvanMvZGRhY2NvcmRpb24u
anMkL1dvcmxkR3Jhbm55L2pzL2pxdWVyeS0xLjIuMi5wYWNrLmpzZAIDD2QWBAIDDxYCHgtfIUl0
ZW1Db3VudAIKFhRmD2QWBAIBDw8WAh4LTmF2aWdhdGVVcmwFFH4vUGFnaW5hLzIvaG9tZS5h
c3B4ZBYCZg8VAQRIb21lZAIDDxYCHwACARYCAgEPZBYCAgEPDxYCHwEFFX4vUGFnaW5hLzQvc3V
iLTEuYXNweGQWAmYPFQEFc3ViIDFkAgEPZBYEAgEPDxYCHwEFG34vUGFnaW5hLzMvb3JnYW5pc2F0a
WUuYXNweGQWAmYPFQELT3JnYW5pc2F0aWVkAgMPFgIfAAICFgQCAQ9kFgICAQ8PFgIfAQUUfi9QYWdpb
mEvNS9zdWIyLmFzcHhkFgJmDxUBBHN1YjJkAgIPZBYCAgEPDxYCHwEFGH4vUGFnaW5hLzgvbmV3LXBhZ2" />
LOL.. long huh
Solution:
put this code in your .cs page
//overwrite the SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium
protected override void SavePageStateToPersistenceMedium(object viewState)
{
}
protected override object LoadPageStateFromPersistenceMedium()
{
return null;
}
// Remove completely after rendering html code
protected override void Render(HtmlTextWriter output)
{
System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
System.IO.StringWriter stringWriter = More >