|
samerh wrote: filling it by a certain time at run time
Are you filling in pageload?
|
|
|
|
|
Yes iam filling txtRef in page load. Then iam pressing btnClear which executes a JS which clears the content of txtRef, but when iam saving it is still getting the same data b4 i clear.
|
|
|
|
|
The problem is
When you press the save button, first the page load happens(It fills the textbox) , then the button postback happens.
I think now you will be able to solve it.
|
|
|
|
|
hi friends
1.Is possible to pass the querystring between webusercontrol to webusercontrol
regards
saravanan
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
I'm not sure I understand the question. A user control is embedded in a page. The query string is tied to the page, and all user controls can see it. What do you want to do ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi ,
In my application which was developed in Visual studio 2003, on the top of the page it contain tabs like in this link : http://www.sitepoint.com/examples/cssaccessiblenav/css-3.htm[^]. The above link contains only one row of tabs. but my application containg 2 rows of tabs(first row contain 4 tabs, second row contain 3 tabs). These 2 rows of tabs are like master page in .Net 2.0 they are repeating for each page.
When we click on first tab in the first row, the tab color is changed to distinguish from remaining tabs in that row. Each page contains one Continue button. when we click on Continue button, it will take to the next page which also contains the two rows of tabs, and second tab color is changed automatically and transfer to the page corresponding to that page. Here the requirement is continue button click take you to the corresponding page and highlight that tab. When the user clicks on the Back button of the browser, it must take you to the previous tab( change its color) and display the page data associated to that tab.
We are rewriting the application in .NET Framework 2.0. So I want to utilize the two master pages(I have top level layout, and second level layout), two menu controls having the datasource as sitemaps one is for first row of tabs and second sitemap is for second row of tabs. Here how we change the color of the links as it is clicked and move those rows up and down. The row of tabs moved to down if it is active. inactive row tabs must move to up.
How to do this bechavoiur?
Thanks
|
|
|
|
|
Sounds like you need to put someting on the URL that tells the tabs how to show themselves ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I've been searching the internet for this for a week. This MUST be simpler than I'm making it.
I have a comic I am updating it online, and I want a link on the main page that leads to the most recently added image, or the first image from the most recently updated date.
I'm using ASP.NET, and I'm definitely a beginner at it. For now, I have been experimenting with IDs, but I'd like to query the date.
So far, all I have is:
<%
ImageID=Request("ImageID")
%>
<a href="BigImageDisplay.asp?<%=LastImageID%>">Newest Page</a>
I've figured out how to compare the Date of the image to the current date and only show images in the archive/gallery that are from the past. But I'm not sure how to go about making sure that when I link to the latest Image, it doesn't link to a 'future' image.
<div class="ForumMod">modified on Wednesday, June 25, 2008 9:02 PM</div>
|
|
|
|
|
midoujulessama wrote:mageID=Request("ImageID")
%>
Why are you doing this in the ASPX instead of the code behind ?
midoujulessama wrote: I've figured out how to compare the Date of the image to the current date and only show images in the archive/gallery that are from the past. But I'm not sure how to go about making sure that when I link to the latest Image, it doesn't link to a 'future' image.
I'd write SQL that asks the database for the Id of the most recent image.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm mod-ing a code that was given to me by my father. I'm doing all my code in the asp file. This file the index.asp file. I don't have any of my files looking at another file, however they do look at the database. Is this not efficient?
Sql statements seem to be giving me the most trouble in this whole endeavor. Is there a good tutorial on sql statements? When I search the web, I just seem to find MySQL and SQL databases.
The other issue I seem to be having is that the most recent image is not always the latest image. If I upload an image that I intend to release on the 30th, won't a basic sql statement choose that even if today is only the 25th because it has the latest date?
Thank you!
|
|
|
|
|
midoujulessama wrote: This file the index.asp file
is it .asp or .aspx ? If .asp, then you're in the wrong forum.
midoujulessama wrote: Is there a good tutorial on sql statements?
SQL is pretty simple, once you get the syntax. I don't know of any off hand, I'd just google for SQL tutorial.
midoujulessama wrote: The other issue I seem to be having is that the most recent image is not always the latest image. If I upload an image that I intend to release on the 30th, won't a basic sql statement choose that even if today is only the 25th because it has the latest date?
OK - then you need to write SQL that gets the comic for the day and store the date in the DB for each comic, I guess.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
you shold use datecompare method for this
Sunny
|
|
|
|
|
I've used the following code to create "Previous" and "Next" links on the image display pages.
In the head:
<%
DIM objConn,RS
ImageRootDirectory="/alltoogently/"
ImageID=Request("ImageID")
sql = "SELECT * FROM QImages WHERE ImageID="&ImageID
Set Conn=Server.CreateObject("ADODB.Connection")
Set RS =Server.CreateObject("ADODB.Recordset")
DSNName = "DRIVER=Microsoft Access Driver (*.mdb);DBQ="
DSNName = DSNName&Server.MapPath("/access_db/alltoogently.mdb")
Conn.Open DSNName
RS.Open sql, Conn, 3, 3
ImageName=RS.Fields("ImageName").Value
ImageHRefFile=RS.Fields("ImageHRefFile").Value
ImageDate=RS.Fields("ImageDate").Value
ImageCaption=RS.Fields("ImageCaption").Value
CategoryTitle=RS.Fields("CategoryTitle").Value
CategoryID=RS.Fields("CategoryID").Value
ImageOrder=RS.Fields("ImageOrder").Value
CategoryDirectory=RS.Fields("CategoryDirectory").Value
ImageFile=ImageRootDirectory&CategoryDirectory&"/"&ImageHRefFile
RS.Close
sql = "SELECT * FROM QImages WHERE CategoryID="&CategoryID
RS.Open sql,Conn,3,3
NRecs=0
NextID=0
PreviousID=0
SaveID="0"
Do
NRecs=NRecs+1
If RS.Fields("ImageDate")<Date then Exit Do
RS.MoveNext
Loop Until RS.EOF
If NRecs>1 then
RS.MovePrevious
PreviousID=RS.Fields("ImageID")
RS.MoveNext
End If
RS.MoveNext
If Not RS.EOF then NextID=RS.Fields("ImageID")
RS.Close
Conn.Close
%>
And In the body:
<%If NextID>0 then
%>
<a href="BigImageDisplay.asp?ImageID=<%=NextID%>">Previous</a>
<%
End If
If ImageDate<Date then
%>
<a href="BigImageDisplay.asp?ImageID=<%=PreviousID%>">Next</a>
<%ImageDate=Date
End If%>
Can I use a similar code for this? Or can I derive the code I need from a this code? Thank you!
|
|
|
|
|
I am creating a server control library and I have a control which has a property named menu. The menu property can be a any server control which inherits from a class named MenuBaseItem. The property is currently defined like this:
<br />
[NotifyParentProperty(true)]<br />
[PersistenceMode(PersistenceMode.InnerProperty)]<br />
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]<br />
public List<MenuBaseItem> items<br />
{<br />
get<br />
{<br />
return _items;<br />
}<br />
}<br />
<br />
What I'd like to be able to do is use an interface instead:
<br />
[NotifyParentProperty(true)]<br />
[PersistenceMode(PersistenceMode.InnerProperty)]<br />
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]<br />
public List<IMenuItem> items<br />
{<br />
get<br />
{<br />
return _items;<br />
}<br />
}<br />
<br />
The above interface IMenuItem will allow an object to convert itself to a menu item so I can include other types as menu items.
My problem is that this will compile, but when I open my aspx template and try to edit the property I no longer get any intellisense list of controls which can be used. Is there another interface which must be implmented as part of IMenuItem that will allow intellisense to work with my solution?
|
|
|
|
|
I have a gridview that contains rows where each row's cell contains a textbox. After inserting a new row into the gridview I want the new row's first textbox to have the focus. I have tried verious ways to set the new row first cell's textbox to have the focus but am unable. Does anyone know how this is done?
Thanks,
Steve
|
|
|
|
|
|
Here is the code I am trying:
protected void GridViewCollectionManagement_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowIndex == focus)
{
// TextBox tb = (TextBox)e.Row.Cells[0].Controls[1];
// this.SetFocus(tb);
DefaultFocus = ((TextBox)e.Row.FindControl ("newCollectionName")).ClientID;
}
One thing to note is that this gridview is contained in a ajax panel and is a content page of a master page.
|
|
|
|
|
My first thought would be to find the row that it is in Insert mode (SelectedRow maybe) and give it focus.
My second thought would be to extend the GridView in a Server Control. Override the Focus() method. In this method, if the GridView is in insert mode (GridView.CurrentMode ), then get the current row (SelectedRow ) and then set the focus to that row. If the GridView is not in insert mode than just pass the call to the base (base.Focus()).
|
|
|
|
|
I have 2 web forms, default.aspx and default2.aspx created in my project. After default.aspx is finish I want to diplay default2 as a thank you page. How do I go about doing this?
Thanks
jds1207
|
|
|
|
|
You could use the Wizard control for that.
|
|
|
|
|
Hi thanks for looking, im studying for test 70-528, but in the simulators ive found some questions that i cant really understand
Let me know what you think about these quesitons. Any comments will be appreciated
The answers at the end of each question are the answers provided in the simulator
You create a Web Form. The Web Form allows users to recover their passwords. You add a PasswordRecovery server control by using the following code segment.
<asp:PasswordRecovery runat="server">
You need to ensure that the server control generates a new password and sends it by e-mail to the users email address.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Create a valid <smtp> definition in the Web.config file.
B. Set the passwordFormat attribute of the configured membership provider to Encrypted.
C. Ensure that the enablePasswordRetrieval attribute of the configured membership provider is set to False.
D. Ensure that the enablePasswordRetrieval attribute of the configured membership provider is set to True.
Answer: A, C
My comments: Should we set the enablePasswordRetrieval to true instead of false?
===========================
You create Web sites for your company. You apply a consistent design to the pages and controls of the Web sites. You need to make style changes to all of the Web sites on the Web server. You want to achieve this goal without having to edit the individual pages on each Web site. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Place a theme in the App_Themes directory under the application root directory.
B. Place a theme under an ASP.NETClientFiles folder under the ASP.NET installation directory.
C. Assign a theme by setting the <%@ Page Theme="..." %> directive to the name of the application theme.
D. Assign a theme by specifying the <pages theme="..."/> section in the Web.config file.
Answer: B, D
========================
You create a Web Form. You need to add controls that use adaptive rendering to display content. The type of content rendered must depend on the device that is requesting the page. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Add custom controls that emit XHTML to the Web Form.
B. Add custom controls that emit WML to the Web Form.
C. Add mobile controls to the Web Form.
D. Add Web server controls to the Web Form.
Answer: C, D
My comments: Ive seen this question with C,D and also B,D as answers, whats the right one?
============================
You create a Web Form that displays a GridView. The GridViews data source is a DataSet named dsOrders. The DataSet contains two DataTables named Orders and OrderDetails. You create a relation between the two DataTables using the following code segment. (Line numbers are included for reference only.)
01 dtOrders = dsOrders.Tables[“Orders”];
02 dtOrderDetails = dsOrders.Tables[“OrderDetail”];
03 colParent = dtOrders.Columns[“OrderID”];
04 colChild = dtOrderDetails.Columns[“ParentOrderID”];
05 dsOrders.Relations.Add(“Rell”, colParent, colChild, false);
You need to find the cause of the exception being raised in line 05. What should you do?
A. Ensure that the child column and the parent column have the same names.
B. Ensure that the child table and the parent table have the same names.
C. Ensure that the child column and the parent column have the same data types.
D. Ensure that each row in the child table has a corresponding row in the parent table.
E. Ensure that the tables have an explicit relationship defined by a foreign key constraint in the database.
Answer: D
My comments: Ive seen this qustion with C D and even B in different tests, i think the rigth one is C since false is being passed as the last parameter to the add method of the relations, what do you think?
Thanks in advance for any feedback
Alexei Rodriguez
|
|
|
|
|
There's been an increase in SQL Injection attacks against Web sites. And a lot of developer are aleady developing Web application in a way that prevents the attack from being effective. But what can you do about it for legacy systems, and what are the best practices really? And how can I show that I'm doing the right thing in my site?
Microsoft Security Advisory (954462): Rise in SQL Injectsion Attacks Exploting Unverified User Data came out yesterday that provides advise and tools to protect against a rise in SQL injection attacks. A recent escalation in attacks on Web sites exploit unverified user data input. The attacks target Web sites that do not follow secure coding practices for accessing and manipulating data stored in a relational database.
But the vulnerability is not exploited in Web applications that follow best practices to verify user data. The Security Advisory provides phone support for customers in the United States and Canada who may have been affected by the vulnerability. International customers are provided a link where you can get help locally.
The Security Advisory provides an overview of the issues, a section for frequently asked questions, and a series of suggestion actions that includes tools to help idenfify if your site is vulnerable.
- Hewlett Packard provides a free scanner, HP Scrawlr, that can identify whether sites are susceptible to SQL injection. It provides a report pages that are vulnerable along with the associated fields.
- A beta versoin of UrlScan restricts the types of HTTP requests that Internet Information Services (IIS) will process. UrlScan 3.0 installes on IIS 5.1 or later and can be found at URLScan Tool 3.0 Beta.
- You can check your source code with SQL Source Code Analysis Tool to detect ASP code that is susceptible. The tool can be found in Microsoft Knowledge Base Article 954476.
- The Security Advisory also contains additional links to best practices on how to avoid SQL injection attacks, including Coding Techniques for protecting against SQL Injection in ASP.NET and other articles.
To learn more about how you can protect your Web site from SQL Injection, see Microsoft Security Advisory (954462): Rise in SQL Injectsion Attacks Exploting Unverified User Data.
|
|
|
|
|
I'm trying to work out what the question is. You know this post will be lost forever, and no-one will ever read it, in a few hours ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
form1.aspx
<br />
under html<br />
<script language="javascript" type="text/javascript"><br />
function calendarPicker(strField)<br />
{<br />
window.open('DatePicker.aspx?field=' + strField,'calendarPopup','width=250,height=190,resizable=yes');<br />
}<br />
</script><br />
<br />
<a href="javascript:;" onclick="calendarPicker('Form1.txtEventDate');" title="Pick Date from Calendar">pick</a>
for the calenderpicker.aspx
Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender<br />
<br />
e.Cell.Controls.Clear()<br />
<br />
<br />
Dim Link As System.Web.UI.HtmlControls.HtmlGenericControl<br />
Link = New System.Web.UI.HtmlControls.HtmlGenericControl<br />
Link.TagName = "a"<br />
Link.InnerText = e.Day.DayNumberText<br />
Link.Attributes.Add("href", String.Format("JavaScript:window.opener.document.{0}.value = '{1:d}'; window.close();", Request.QueryString("field"), e.Day.Date))<br />
<br />
<br />
If e.Day.IsSelected Then<br />
Link.Attributes.Add("style", Me.Calendar1.SelectedDayStyle.ToString())<br />
End If<br />
<br />
<br />
'// Now add our custom link to the page<br />
e.Cell.Controls.Add(Link)<br />
<br />
End Sub
|
|
|
|
|
Which part of codes are not working ? OR I mean to say when ?
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|