|
Thank you i will try that,
However, there was a simple block of code i found but i cannot find it.
Is there some code that will convert/encode a byte array as a BASE-10 encoding, and one to decode.
I can find many that will encode my byte array to represent base 24, base 32 or HEX but not a string of digits (base 10)
Thank you
Steve
|
|
|
|
|
If I wanted to do this I probably would download the source code mentioned in the document, open up main.c, read it, find that the DecodeInstID function implements the algorithm, and then translate that into C#. Is this what you did, but then forgot?
Alan.
|
|
|
|
|
Yes but it has been so long i have forgot my c and i tried that but cant figure it out.
Steve
|
|
|
|
|
Hello. I have searched for a way to P/Invoke the Graphics.FillPolygon(Brush, Point[]) method. I saw that it is much faster to do so (likely because it bypasses error checking that is unneeded in a well-made program). However, I have not found any examples of how to do so (even .NET Reflector is of no help, only referring me to a P/Invoke that uses a private native field). Please help me translate this code into a P/Invoke. The FillPolygon method is the most important by far, as it is called 10 times more often in the real code as the Clear method is. This Render method takes up an average of 75% of the time in the code, as profiled by NProf (a specially modified version that samples 5x as often as usual was used).
public static void Render(Color color, SolidBrush brush, Point[] points, Graphics graphics)
{
graphics.Clear(color);
graphics.FillPolygon(brush, points);
}
|
|
|
|
|
This is the MSDN page[^] for the Polygon function in gdi32. You need to set the brush and fill mode first and it will draw it filled for you.
[Added]This page[^] gives you the gdi+ function signatures[/Added]
|
|
|
|
|
Thanks, but how do I apply this using C# code? Oh, and what you showed me is normal GDI. System.Graphics uses GDI+. Is this any problem? (I have heard normal GDI is faster, though; is this true?). Here is a slightly modified version of the context within which the code is used:
if (!isPerformanceTest)
{
Renderer.Render(newDrawing , g));
}
bitmapData = bitmap.LockBits(
new Rectangle(0, 0, (int)(Tools.MaxWidth / reduction), (int)(Tools.MaxHeight / reduction)),
ImageLockMode.ReadOnly,
PixelFormat.Format32bppArgb);
I would like some code if at all possible.
|
|
|
|
|
I'd have to work at and test a C# PInvoke method. I have edited the original post with a link to the MSDN GDI+ page[^] with the GdipFillPolygon function signature (gdipluss.dll).
|
|
|
|
|
Here is the complete source code of the program. It may only be used under the provisions of the GPL. This is not Roger Alsing's original work; it has been very highly optimized. Further optimization of other sections is almost useless without optimization of the renderer. I tried Direct3D, which was very good, but it had WAY too many bugs to even attempt to continue on. The Render method is in the Renderer.cs file and is called by FitnessCalculator.cs, which is in turn called by MainForm.cs. The DnaPolygon.cs and DnaDrawing.cs files are used extensively.
Download Source Code
The two lines of the Render method that I mentioned in the original post together take more than 70% of the CPU time of the program.
|
|
|
|
|
Hi,
I am trying to create a web software that will get a URL where is has a long list of links (each link lead to a pge where i want to check a certain filed and get its data), and from that moment on will run alone, using the 'back' option to get back to the previous page where it has the list, then entering the next link and so on.
How can I do that? I know I can cntrol IE but I am not sure if it will be enough...
Thanks for any help ninjas
|
|
|
|
|
You don't need a browser for that, it is much easier using just (Http)WebRequest and (Http)WebResponse, then somewhat parse the HTML page you get.
BTW: Make sure to keep a list of URLs already visited, to prevent running in circles.
|
|
|
|
|
Hi Luc thank you very much for your help!
Will i be able to navigate from that page? As if clicked the 'back' button?
and thanks for the tip with list it will definitely help me saving some time
|
|
|
|
|
There is no need for going back; this is how I make a sniffer:
1. create a list of pages already seen; it starts out empty;
2. create a list of pages to visit; it starts out with a single URL;
3. fetch the first page in ToVisit; remove it from ToVisit and add it to AlreadySeen;
4. parse the page and add all URLs of interest to ToVisit, unless they are already in AlreadySeen;
5. if (ToVisit not empty) goto 3
remarks:
1. one advantage of this approach is it performs a breadth-first traversal, so it is not wandering off right away.
2. of course you must be careful to limit the reach of the sniffer; maybe you don't want to parse pages whose URL don't start with the URL of the very first page (so www.XXX.com will visit and scan www.XXX.com/more but will not dive into www.microsoft.com)
|
|
|
|
|
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.
|
|
|
|
|