|
Thats a great way and I would definitely use it.
What happens when you dont have a list in advance, and you want keep flowing on the list? it is a large list on that page and getting all its url's will be force me to actually get there...
|
|
|
|
|
Sorry, I didn't understand that.
|
|
|
|
|
Hello
My apologies to jump into this thread but I have a very similar question
My goal is more to emulate command on a web page than simply browse the different link from pages to pages
The problem is How to identify command syntax ?
In some case I can use Firebug to see what command is sended and then reuse the command with specific parameters using Csharp and an HttpWebRequest
But Firebug do not always shows the command
Is there any way to "sniff" commands and see exactly what is sended ?
|
|
|
|
|
baranils wrote: Is there any way to "sniff" commands and see exactly what is sended ?
There is no general solution AFAIK. The page could be full of JavaScript, it could calculate whatever it chooses, and then fetch another page from there.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thank you Luc
In my case it should not be too complicate I hope
The control is a dropdown list and I can already get the elements of the drop down in the Html content
The problem is that I can't see what command is sended when the dropdown value changes
What would be a good approach to get it ?
N.B : I do not understand why is some case such commands are shown into firebug and in other case not ?
What can be the difference ?
|
|
|
|
|
it could be as simple as an HTML form with a "dropdown"; the form's action could be a GET (=regular URL will be used) or a POST; the inputs of the form then get appended to the URL. That would really only fetch a new page upon pressing a button.
and it could be almost anything when JavaScript is used, as with an OnClick method, and maybe an OnSelectionChanged method or something similar. I can't tell you more.,
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thank for your help Luc
I will continue to investigate.
I'm certainly not the first to try to automate a web page and it must be a way anyway to check what the page is sending to get an answer
I can understand that with a WinForm application it is not so easy to trace the event and methods. Anyway a good debugger can do it
I can't believe that it will be more complicate to get the outgoing flow from a web page ?
I will continue to learn about this interesting topic
|
|
|
|
|
Hi. Is it possible to have a MAC OS look in your WinForm controls? Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
Why on earth would you want to do that?
If your app is the only mac-a-like on a windows system, it is going to look pretty silly.
You can do it, if you must, but I think you will have to draw all the controls yourself. And the menus. And the Form borders. And the scroll bars. And the system buttons. And the cursors. And the Message boxes. And the standard dialogs.
It would be a lot quicker, and cheaper, to buy a mac instead.You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
OriginalGriff wrote: Why on earth would you want to do that?
crazy Manager .
OriginalGriff wrote: it is going to look pretty silly.
You have a humorous way of making the point . I like it .
OriginalGriff wrote: It would be a lot quicker, and cheaper, to buy a mac instead.
You are extreamly funny.
Thanks anyway. A five for this message.Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
CocoaSharp[^] might also be an interesting option I are Troll
|
|
|
|
|
<%@ Page Language="c#" Inherits="Telerik.ListViewExamplesCSharp.FirstLook.DefaultCS"
CodeFile="DefaultCS.aspx.cs" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
<%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
<%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<telerik:HeadTag runat="server" ID="Headtag2" />
<style type="text/css">
.rdpWrap .RadInput, .rdpWrap .rdpPagerButton, .rdpWrap .rdpPagerLabel
{
float: left;
}
</style>
</head>
<body class="BODY">
<form runat="server" id="mainForm" method="post">
<div>
<telerik:Header runat="server" ID="Header1" NavigationLanguage="CS" ShowSkinChooser="false"
ShowDbResetTimer="true" />
<!-- content start -->
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadListView1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadListView2">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadListView2" />
<telerik:AjaxUpdatedControl ControlID="lblDescription" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="ddListSort">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="rblSort">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="rblSort" UpdatePanelRenderMode="Inline" />
<telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="CheckBoxList1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="CheckBoxList1" />
<telerik:AjaxUpdatedControl ControlID="RadListView1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<ClientEvents OnRequestStart="RequestStart" />
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function RequestStart(sender, eventArgs) {
//disable ajax on update/insert operation to upload the image
if ((eventArgs.get_eventTarget().indexOf("Update") > -1) || (eventArgs.get_eventTarget().indexOf("PerformInsert") > -1)) {
eventArgs.set_enableAjax(false);
}
}
</script>
</telerik:RadCodeBlock>
<qsf:ConfiguratorPanel runat="server" ID="ConfigurationPanel1" Title="Configurator"
Expanded="false">
Use check boxes bellow to customize the RadDataPager control
<asp:CheckBoxList runat="server" ID="CheckBoxList1" AutoPostBack="true" RepeatColumns="2"
RepeatDirection="Vertical" OnSelectedIndexChanged="CheckBoxList1_SelectedIndexChanged"
RepeatLayout="Table" CellSpacing="10">
<asp:ListItem Value="1" Text="FirstPrev button fields" Selected="True"></asp:ListItem>
<asp:ListItem Value="2" Text="Numeric button fields" Selected="True"></asp:ListItem>
<asp:ListItem Value="3" Text="NextLast button fields" Selected="True"></asp:ListItem>
<asp:ListItem Value="4" Text="Page size field" Selected="True"></asp:ListItem>
<asp:ListItem Value="5" Text="Go-to-page field" Selected="True"></asp:ListItem>
<asp:ListItem Value="6" Text="Template field" Selected="True"></asp:ListItem>
</asp:CheckBoxList>
</qsf:ConfiguratorPanel>
<table>
<tr>
<td>
<h3 class="qsfSubtitle">
Editable RadListView with tiled layout</h3>
<telerik:RadListView ID="RadListView1" DataSourceID="SqlDataSource1" runat="server"
ItemPlaceholderID="CustomersContainer" DataKeyNames="CustomerID" AllowPaging="true"
OnItemCommand="RadListView1_ItemCommand">
<LayoutTemplate>
<!-- Set the id of the wrapping container to match the CLIENT ID of the RadListView control to display the ajax loading panel
In case the listview is embedded in another server control, you will need to append the id of that server control -->
<fieldset id="RadListView1">
<legend>Customers</legend>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
PageSize="2" Width="780px">
<Fields>
<telerik:RadDataPagerButtonField FieldType="FirstPrev" />
<telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="6" />
<telerik:RadDataPagerButtonField FieldType="NextLast" />
<telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
<telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
TextBoxWidth="15" />
<telerik:RadDataPagerTemplatePageField>
<PagerTemplate>
<div style="float: right; padding-left: 50px;">
<b>Items
<asp:Label runat="server" ID="CurrentPageLabel" Text="<%# (Container.Owner.TotalRowCount > 0)? Container.Owner.StartRowIndex + 1 : 0%>" />
to
<asp:Label runat="server" ID="TotalPagesLabel" Text="<%# (Container.Owner.TotalRowCount > 0)? Container.Owner.StartRowIndex + Container.Owner.PageSize : 0 %>" />
of
<asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" />
<br />
</b>
</div>
</PagerTemplate>
</telerik:RadDataPagerTemplatePageField>
</Fields>
</telerik:RadDataPager>
</td>
</tr>
</table>
<asp:PlaceHolder ID="CustomersContainer" runat="server" />
<div style="clear: both" />
<br />
<br />
<table style="width: 100%;">
<tr>
<td style="width: 25%;">
<asp:Button ID="btnInitInsert" runat="server" Text="Insert Customer" OnClick="btnInitInsert_Click" />
</td>
<td style="text-align: right; width: 75%;">
<asp:Label ID="lblSort1" runat="server" Text="Sort by:" Style="padding-right: 5px;" />
<telerik:RadComboBox ID="ddListSort" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddListSort_SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem Text="-Select field to sort-" Value="" />
<telerik:RadComboBoxItem Text="Company name" Value="CompanyName" />
<telerik:RadComboBoxItem Text="Contact name" Value="ContactName" />
<telerik:RadComboBoxItem Text="Title" Value="ContactTitle" />
<telerik:RadComboBoxItem Text="City" Value="City" />
<telerik:RadComboBoxItem Text="Country" Value="Country" />
<telerik:RadComboBoxItem Text="Clear sort" Value="ClearSort" />
</Items>
</telerik:RadComboBox>
<asp:RadioButtonList RepeatLayout="Flow" RepeatDirection="Horizontal" ID="rblSort"
runat="server" AutoPostBack="true" OnSelectedIndexChanged="rblSort_SelectedIndexChanged">
<asp:ListItem Text="Ascending" Value="ASC" Selected="True" />
<asp:ListItem Text="Descending" Value="DESC" />
</asp:RadioButtonList>
</td>
</tr>
</table>
</fieldset>
</LayoutTemplate>
<ItemTemplate>
<!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
in the tiles layout-->
<fieldset style="float: left; width: 370px; height: 185px;">
<legend>Company name:
<%# Eval("CompanyName") %></legend>
<table cellpadding="0" cellspacing="0" style="height: 100%;" width="370px">
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td style="width: 25%">
Name:
</td>
<td style="width: 50%">
<%#Eval("ContactName")%>
</td>
</tr>
<tr>
<td>
Title:
</td>
<td>
<%#Eval("ContactTitle")%>
</td>
</tr>
<tr>
<td>
City:
</td>
<td>
<%# Eval("City")%>
</td>
</tr>
<tr>
<td>
Country:
</td>
<td>
<%# Eval("Country")%>
</td>
</tr>
<tr>
<td>
Phone:
</td>
<td>
<%#Eval("Phone")%>
</td>
</tr>
</table>
</td>
<td align="right" style="width: 30%; padding-left: 10px;">
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="Contact Photo"
ToolTip="Contact Photo" Width="90px" Height="110px" ResizeMode="Fit" DataValue='<%# Eval("Photo") %>' />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table style="width: 100%;">
<tr>
<td>
<asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" Width="50px" />
</td>
<td style="text-align: right">
<asp:Button ID="btnDelete" runat="server" Text="Delete" CommandName="Delete" Width="50px" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</ItemTemplate>
<EditItemTemplate>
<!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
in the tiles layout-->
<fieldset style="float: left; width: 370px; height: 185px;">
<legend>Company name:
<asp:TextBox ID="txtBoxCompanyName" runat="server" Text='<%#Bind("CompanyName")%>' />
<asp:RequiredFieldValidator ID="rvCompanyName" runat="server" ControlToValidate="txtBoxCompanyName"
ErrorMessage="Please enter company name" Display="Dynamic" />
</legend>
<table cellpadding="0" cellspacing="0" style="width: 370px;">
<tr>
<td>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<table cellpadding="0" cellspacing="2">
<tr>
<td style="width: 25%">
Name:
</td>
<td style="width: 75%">
<asp:TextBox ID="txtBoxName" runat="server" Text='<%#Bind("ContactName")%>' />
<asp:RequiredFieldValidator ID="rvName" runat="server" ControlToValidate="txtBoxName"
ErrorMessage="Please enter name" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
Title:
</td>
<td>
<asp:TextBox ID="txtBoxTitle" runat="server" Text='<%#Bind("ContactTitle")%>' />
<asp:RequiredFieldValidator ID="rvTitle" runat="server" ControlToValidate="txtBoxTitle"
ErrorMessage="Please enter title" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
City:
</td>
<td>
<asp:TextBox ID="txtBoxCity" runat="server" Text='<%#Bind("City")%>' />
<asp:RequiredFieldValidator ID="rvCity" runat="server" ControlToValidate="txtBoxCity"
ErrorMessage="Please enter city" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
Country:
</td>
<td>
<asp:TextBox ID="txtBoxCountry" runat="server" Text='<%#Bind("Country")%>' />
<asp:RequiredFieldValidator ID="rvCountry" runat="server" ControlToValidate="txtBoxCountry"
ErrorMessage="Please enter country" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
Phone:
</td>
<td>
<asp:TextBox ID="txtBoxPhone" runat="server" Text='<%#Bind("Phone")%>' />
<asp:RequiredFieldValidator ID="rvPhone" runat="server" ControlToValidate="txtBoxPhone"
ErrorMessage="Please enter phone" Display="Dynamic" />
</td>
</tr>
</table>
</td>
<td align="right" style="width: 25%; padding-left: 10px;">
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="Contact Photo"
ToolTip="Contact Photo" Width="90px" Height="110px" ResizeMode="Fit" DataValue='<%# Eval("Photo") %>' />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<div style="float: left; width: 160px;">
<asp:Button ID="btnUpdate" runat="server" Text="Update" CommandName="Update" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false" />
</div>
<telerik:RadUpload ID="ruCustomerImage" runat="server" AllowedFileExtensions=".jpg,.jpeg,.gif,.png"
MaxFileSize="1000000" ControlObjectsVisibility="None" InputSize="12" Width="160px"
Style="float: right" />
<div style="clear: both" />
</td>
</tr>
</table>
</fieldset>
</EditItemTemplate>
<InsertItemTemplate>
<!--The widths/heights of the fieldset/outer tables in the item/edit/insert templates should match to avoid wrapping or visual discrepancies
in the tiles layout-->
<fieldset style="float: left; width: 370px; height: 200px;">
<legend>Company name:
<asp:TextBox ID="txtBoxCompanyName" runat="server" />
<asp:RequiredFieldValidator ID="rvCompanyName" runat="server" ControlToValidate="txtBoxCompanyName"
ErrorMessage="Please enter company name" Display="Dynamic" />
</legend>
<table cellpadding="0" cellspacing="0" style="width: 370px;">
<tr>
<td>
<table cellpadding="0" cellspacing="5">
<tr>
<td style="width: 25%">
Name:
</td>
<td style="width: 75%">
<asp:TextBox ID="txtBoxName" runat="server" />
<asp:RequiredFieldValidator ID="rvName" runat="server" ControlToValidate="txtBoxName"
ErrorMessage="Please enter name" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
Title:
</td>
<td>
<asp:TextBox ID="txtBoxTitle" runat="server" />
<asp:RequiredFieldValidator ID="rvTitle" runat="server" ControlToValidate="txtBoxTitle"
ErrorMessage="Please enter title" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
City:
</td>
<td>
<asp:TextBox ID="txtBoxCity" runat="server" />
<asp:RequiredFieldValidator ID="rvCity" runat="server" ControlToValidate="txtBoxCity"
ErrorMessage="Please enter city" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
Country:
</td>
<td>
<asp:TextBox ID="txtBoxCountry" runat="server" />
<asp:RequiredFieldValidator ID="rvCountry" runat="server" ControlToValidate="txtBoxCountry"
ErrorMessage="Please enter country" Display="Dynamic" />
</td>
</tr>
<tr>
<td>
Phone:
</td>
<td>
<asp:TextBox ID="txtBoxPhone" runat="server" />
<asp:RequiredFieldValidator ID="rvPhone" runat="server" ControlToValidate="txtBoxPhone"
ErrorMessage="Please enter phone" Display="Dynamic" />
</td>
</tr>
</table>
</td>
<td align="right" style="width: 25%; padding-left: 10px;">
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="No Photo"
ToolTip="No Photo" Width="90px" Height="110px" ResizeMode="Fit" ImageUrl="~/ListView/Examples/FirstLook/Img/EmtpyCategoryImage.jpg" />
</td>
</tr>
<tr>
<td colspan="2">
<div style="float: left; width: 160px;">
<asp:Button ID="btnPerformInsert" runat="server" Text="Insert" CommandName="PerformInsert" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false" />
</div>
<telerik:RadUpload ID="ruCustomerImage" runat="server" AllowedFileExtensions=".jpg,.jpeg,.gif,.png"
MaxFileSize="1000000" ControlObjectsVisibility="None" InputSize="12" Width="160px"
Style="float: right" />
<div style="clear: both" />
</td>
</tr>
</table>
</fieldset>
</InsertItemTemplate>
<EmptyDataTemplate>
<fieldset style="width: 800px">
<legend>Customers</legend>No records for customers available.
</fieldset>
</EmptyDataTemplate>
</telerik:RadListView>
</td>
</tr>
<tr>
<td>
<h3 class="qsfSubtitle">
Grouped RadListView</h3>
<qsf:InformationBox ID="InfoBox1" runat="server">
Select a category to view its description
</qsf:InformationBox>
<telerik:RadListView ID="RadListView2" DataSourceID="SqlDataSource2" runat="server"
ItemPlaceholderID="CategoriesContainer" GroupPlaceholderID="GroupCategoriesContainer"
GroupItemCount="3" DataKeyNames="CategoryID" OnSelectedIndexChanged="RadListView2_SelectedIndexChanged">
<LayoutTemplate>
<fieldset id="GroupCategoriesContainer" runat="server" />
</LayoutTemplate>
<GroupTemplate>
<fieldset style="float: left;">
<legend>Categories group</legend>
<table>
<tr>
<asp:PlaceHolder ID="CategoriesContainer" runat="server" />
</tr>
</table>
</fieldset>
</GroupTemplate>
<ItemTemplate>
<td>
<asp:LinkButton ID="imgButton" runat="server" CommandName="Select">
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="Category Photo"
Style="margin-left: 10px" ToolTip="Category Photo" Width="90px" Height="62px"
BorderColor="White" BorderWidth="2px" ResizeMode="Fit" ImageUrl='<%# string.Format("IMG/{0}.jpg", Eval("CategoryID")) %>' />
</asp:LinkButton>
<br />
<%#Eval("CategoryName")%>
<br />
</td>
</ItemTemplate>
<EmptyItemTemplate>
<td>
<img src="Img/EmtpyCategoryImage.jpg" width="110px" height="62px" alt="No Category to display"
title="No Category to display" />
</td>
</EmptyItemTemplate>
<SelectedItemTemplate>
<td>
<asp:LinkButton ID="imgButton" runat="server" CommandName="Select">
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AlternateText="Category Photo"
Style="margin-left: 10px" ToolTip="Category Photo" Width="90px" Height="62px"
BorderColor="Blue" BorderWidth="2px" ResizeMode="Fit" ImageUrl='<%# string.Format("IMG/{0}.jpg", Eval("CategoryID")) %>' />
</asp:LinkButton>
<br />
<span style="color: blue;">
<%#Eval("CategoryName")%></span>
<br />
</td>
</SelectedItemTemplate>
</telerik:RadListView>
</td>
</tr>
<tr>
<td>
<fieldset>
<legend>Description</legend>
<asp:Label ID="lblDescription" runat="server" />
</fieldset>
</td>
</tr>
</table>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle], [City], [Country], [Phone], [Photo] FROM [CustomerPhotos]"
DeleteCommand="DELETE FROM [CustomerPhotos] WHERE [CustomerID] = @CustomerID"
InsertCommand="INSERT INTO [CustomerPhotos] ([CustomerID], [CompanyName], [ContactName], [ContactTitle], [City], [Country], [Phone], [Photo]) VALUES (@CustomerID, @CompanyName, @ContactName, @ContactTitle, @City, @Country, @Phone, @Photo)"
UpdateCommand="UPDATE [CustomerPhotos] SET [CompanyName] = @CompanyName, [ContactName] = @ContactName, [ContactTitle] = @ContactTitle, [City] = @City, [Country] = @Country, [Phone] = @Phone, [Photo] = @Photo WHERE [CustomerID] = @CustomerID"
OnInserting="SqlDataSource1_Inserting" OnUpdating="SqlDataSource1_Updating">
<DeleteParameters>
<asp:Parameter Name="CustomerID" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="CompanyName" Type="String" />
<asp:Parameter Name="ContactName" Type="String" />
<asp:Parameter Name="ContactTitle" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="Country" Type="String" />
<asp:Parameter Name="Phone" Type="String" />
<asp:Parameter Name="Photo" DbType="Binary" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="CustomerID" Type="String" />
<asp:Parameter Name="CompanyName" Type="String" />
<asp:Parameter Name="ContactName" Type="String" />
<asp:Parameter Name="ContactTitle" Type="String" />
<asp:Parameter Name="City" Type="String" />
<asp:Parameter Name="Country" Type="String" />
<asp:Parameter Name="Phone" Type="String" />
<asp:Parameter Name="Photo" DbType="Binary" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT TOP 5 CategoryID, CategoryName, Description, Picture FROM Categories" />
<!-- content end -->
<telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
</div>
</form>
</body>
</html><code></code>
|
|
|
|
|
I solved the problem ,thanks to everyone.
|
|
|
|
|
You'll probably get a much better response from telerik..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I have created a check that if path exsist by creating and removing temporary folder. Is there any better check to check if a path inside string is valid?
Edit: Rephased
Edit 2: More Info
I used like This: (From Memory)
String path = "c:\TempCacheFolder";
Directory.CreateDirectory(path);
Directory.RemoveDirectory(path);
I needed to know if imputed string is valid before creating. I am currently designing Cache Engine for my custom control. The property CacheFilePath has get and set property. When someone programaticly enter an invalid area where it can't be written, without actually creating it before it is needed. And there is error within my approach. If I create directory with a path that have more subfolder that doesn't exsist:
Example:
Faze1. Test Create a folder.
C:\MyApp\UnkownFolder\Unkownfolder2\TempImageCache.
Faze2. Remove Folder. (Will remove only TempImageCache)
I wan't to avoid this needless step. I only wan't to validate, that the unknown directory can be created without actually creating before needing.
I am sorry if I was too cryptic about my previous postsmodified on Saturday, March 6, 2010 9:32 AM
|
|
|
|
|
using System.IO;
string myPath = @"C:\Windows";
if (Directory.Exists(myPath))
{
} .45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I know, but the string path migt or might not exsist. I am already using this before atempting to create and delete folder
|
|
|
|
|
I don't understand. You mean the string itself might be empty/null? It really shouldn't matter. If you pass a null/empty string to the Exists method, it will return false (or throw an exception). Just write the appropriate code to handle either condition..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: I don't understand. You mean the string itself might be empty/null?
Might be. It could lead to an invalid folder like on Storage devices when removed. The folder itself doesn't have to exsist. Like temporary folder, where cache is placed. In other obvious errors, like invalid chars.
|
|
|
|
|
I suggest that you write a console app and play around with it. You seem to be aware of everything that coudl be wrong with a path name, so see what the DirectoryExists() method does with the various invalid possibilities.
You could have figured all that out on your own by now...
Be a programmer, fer christ's sake..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks for the info. It seems i would need to create my own parser. Thanks for everyone for their commets.
|
|
|
|
|
Ah, so you just want to see if a hypothetical path (which may or may not already exist on the file system) is valid as far as the characters it uses and length and such? In that case, you have two options. Option 1 would be to use this code and catch exceptions for invalid characters and such (various types of exceptions will be thrown based on how the path is invalid):
DirectoryInfo di = new DirectoryInfo("***");
FileInfo fi = new FileInfo("***");
The other option is to check this manually. Some things to consider when creating this code:
Path.AltDirectorySeparatorChar
Path.DirectorySeparatorChar
Path.GetInvalidFileNameChars()
Path.GetInvalidPathChars()
Check if root drives exist (may not apply to network paths)
Avoid known bad folder names (e.g., COM or something like that is invalid because it is reserved).
Path.VolumeSeparatorChar
Maximum path length (260 characters?) and max filename length.
If the path does exist, then it must be valid (but determining if it is invalid will take more work).
|
|
|
|
|
Thank for your reply. It seems it is easiest to do is use Directory.CreateDirectory() and see if it can create. That Path class has some interesting methods.
|
|
|
|
|
I just use a FileInfo. Don't try to write your own.
|
|
|
|
|
Nope. FileInfo is not what I wanted. I asked about Directory not file.
I used like This: (From Memory)
String path = "c:\TempCacheFolder";
Directory.CreateDirectory(path);
Directory.RemoveDirectory(path);
I needed to know if imputed string is valid before creating. I am currently designing Cache Engine for my custom control. The property CacheFilePath has get and set property. When someone programaticly enter an invalid area where it can't be written, without actually creating it before it is needed. And there is error within my approach. If I create directory with a path that have more subfolder that doesn't exsist:
Example:
Faze1. Test Create a folder.
C:\MyApp\UnkownFolder\Unkownfolder2\TempImageCache.
Faze2. Remove Folder. (Will remove only TempImageCache)
I wan't to avoid this needless step. I only wan't to validate, that the unknown directory can be created without actually creating before needing.
I am sorry if I was too cryptic about my previous posts
|
|
|
|