|
hello !
a problem xml and gridview
XML file: aa.xml
<
<br />
<big><br />
<a><br />
<b id="1"><br />
<c> value 1 </c><br />
<c> value 2 </c><br />
<c> value 3 </c><br />
</b><br />
<b id="2"><br />
<c> value 1 </c><br />
<c> value 2 </c><br />
<c> value 3 </c><br />
</b><br />
</a></big><br /> >
'=====================
the following is asp.net code:
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="aa.xml"
XPath="//b[@id="1"]/c/text()">
<asp:GridView ID="GridView1" runat="server" DataSourceID="XmlDataSource1">
'=========
is no result.
i need gridview result is :
-----------------
| b |
|---------------|
| value 1 |
| value 2 |
| value 3 |
-----------------
help?????
hello!
|
|
|
|
|
hello !
a problem xml and gridview
XML file: aa.xml
'===============
<c> value 1
<c> value 2
<c> value 3
<c> value 1
<c> value 2
<c> value 3
'=====================
the following is asp.net code:
<asp:xmldatasource id="XmlDataSource1" runat="server" datafile="aa.xml"
="" xpath="//b[@id=" 1"]="" c="" text()"="">
<asp:gridview id="GridView1" runat="server" datasourceid="XmlDataSource1">
'=========
is no result.
i need gridview result is :
-----------------
| b |
|---------------|
| value 1 |
| value 2 |
| value 3 |
-----------------
help?????
hello!
|
|
|
|
|
Sorry but one post is enough What you tried so far
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I am developing a website in asp.net. In one of the form i need to bind the controls with database. i am using vb.net on back side.
i want ,when we click on next button next record should be shown.
i have done this in vb.net window application ,in that case
i was using:
'Rbtnop1.DataBindings.Add("text", ds, "paper.op1")
'Rbtnop2.DataBindings.Add("text", ds, "paper.op2")
and on button click i was incresing the position by 1 so that next record can be shown.but this is not working in case of web controls.so can tou suggest me something regarding this.
|
|
|
|
|
StringBuilder sbData = sbDataToPost(SendingParameter);
SendingParameter.Url = "www.myweb.com/index.php";
System.Net.HttpWebRequest Request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(SendingParameter.Url);
Request.Proxy=System.Net.WebProxy.GetDefaultProxy();
Request.Method = "POST";
Request.ContentLength = sbData.Length;
Request.ContentType = "application/x-www-form-urlencoded";
try
{
System.IO.StreamWriter srWriter = new System.IO.StreamWriter(Request.GetRequestStream());
srWriter.Write(sbData);
}
catch
{
return false;
}
System.Net.HttpWebResponse Response = (System.Net.HttpWebResponse)Request.GetResponse();
String ver = Response.ProtocolVersion.ToString();
System.IO.StreamReader reader = new
System.IO.StreamReader(Response.GetResponseStream());
string str = reader.ReadToEnd();
return true;
need help
thats my code and didn't work.
i read it on codeproject.and didn't work.
plz help.
|
|
|
|
|
Ahmad Adnan wrote: thats my code and didn't work.
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
What does the sbDataToPost method do?
What does SendingParameter contain?
Do you url-encode the data that you send?
Ahmad Adnan wrote: srWriter.Write(sbData);
There is no overload of the StreamWriter.Write method that takes a StringBuilder. Don't you get a compiler error on that line?
Ahmad Adnan wrote: catch
{
return false;
}
Don't catch everything and throw it away like that. Only catch the exceptions that you know how to handle, otherwise you'll never know what went wrong.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi All,
I am trying to drag and drop a div in javascript. I am calling this function on button click event.
function CreateControl(id) {
var ctrlString="";
ctrlString+="";
ctrlString+=" ";
ctrlString+="";
ctrlString+="";
ctrlString+=" ";
return ctrlString;
}
This function creates a div which contains two other divs and one textbox and a button. Actually it is a chat box window which has a header, message area and textbox in which user types in message and click on send button to post to it other user.
I am using following code to drag and drop this control:
document.onmousemove = mouseMove;
document.onmouseup = mouseUp;
var dragObject = null;
var mouseOffset = null;
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
function mouseUp(){
dragObject = null;
}
function ClearAllObjects() {
dragObject=null;
}
function getMouseOffset(target, ev){
ev = ev || window.event;
var docPos = getPosition(target);
var mousePos = mouseCoords(ev);
return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
}
function getPosition(e){
var left = 0;
var top = 0;
while (e.offsetParent){
left += e.offsetLeft;
top += e.offsetTop;
e = e.offsetParent;
}
left += e.offsetLeft;
top += e.offsetTop;
return {x:left, y:top};
}
function mouseMove(ev){
ev = ev || window.event;
var mousePos = mouseCoords(ev);
if(dragObject){
document.getElementById("Text2").value=dragObject.id;
dragObject.style.position = 'absolute';
dragObject.style.top = mousePos.y - mouseOffset.y;
dragObject.style.left = mousePos.x - mouseOffset.x;
return false;
}
}
function mouseUp(){
dragObject = null;
document.getElementById("Text2").value="0";
}
function makeDraggable(item){
var obj=document.getElementById(item).parentElement;
document.getElementById("Text1").value=item;
if(document.getElementById("Text2").value="1") {
if(!obj) return;
obj.onmousedown = function(ev){
dragObject = this;
mouseOffset = getMouseOffset(this, ev);
return false;
}
}
else {
dragObject=null;
}
}
function Button1_onclick() {
var txtId=document.getElementById("Text1").value;
if(txtId!=null){
document.getElementById("Text1").value=document.getElementById ("Text1").value + 1;
var divHtml=CreateControl(document.getElementById("Text1").value);
}
else {
document.getElementById("Text1").value=1;
}
document.getElementById("mainSpace").innerHTML=document.getElementById("mainSpace").innerHTML + divHtml;
}
Now the problem is that i want that window should be dragged by clicking on header only. It works fine when page is loaded first time. But once i drag it from header then after that it gets dragged on mousedown event on any area of the window. I have tried to figure out the problem but to no vain. I will appreciate if somebody knows the solution of this problem.
Thanks,
Ahmad
|
|
|
|
|
Hi all,
I'm using GridView with an ImageField column and somehow it doesn't display the pictures in my db.
This is the code for adding new picture to the db (which I took from codeproject site)
<br />
if (!Page.IsValid)<br />
return;<br />
if (!FileUpload1.HasFile)<br />
return;<br />
try<br />
{<br />
int len = FileUpload1.PostedFile.ContentLength;<br />
byte[] pic = new byte[len];<br />
FileUpload1.PostedFile.InputStream.Read(pic, 0, len);<br />
int glrId = int.Parse(_GallaryDropDownList.SelectedValue);<br />
_engine.AddPicture(gallrId, pic, _DescTextBox.Text);<br />
}<br />
catch<br />
{...<br />
}<br />
The GridView markup is the following:
<br />
<asp:GridView ID="GridView1" runat="server" ForeColor="Navy" Width="100%" AutoGenerateColumns="False"<br />
DataKeyNames="picID" DataSourceID="_PicturesSqlDataSource" Font-Names="Arial"<br />
Font-Size="11pt"><br />
<Columns><br />
<asp:BoundField DataField="picID" HeaderText="picID" InsertVisible="False" ReadOnly="True"<br />
SortExpression="picID" Visible="False" /><br />
<asp:BoundField DataField="picGlrID" HeaderText="picGlrID" SortExpression="picGlrID"<br />
Visible="False" /><br />
<asp:ImageField DataAlternateTextField="picDEscription" DataImageUrlField="picData"<br />
HeaderText="picture"><br />
</asp:ImageField><br />
<asp:BoundField DataField="picDEscription" HeaderText="description" SortExpression="picDEscription" /><br />
<asp:TemplateField><br />
<ItemTemplate><br />
<asp:CheckBox ID="_SelForDelCheckBox" runat="server" /><br />
</ItemTemplate><br />
</asp:TemplateField><br />
</Columns><br />
</asp:GridView><br />
When I go to that page, I can see the rows but I cannot see the images, I can see the alt text instead..
Can you help me with that? What am I doing wrong?
Thank you,
Roy.
|
|
|
|
|
Im writing a page that contains a data repeater.
within the repeaters item template i go into javascript and declare an SWFObject (this is a javascript helper class for writing out flash videos onto the page). I need to pass the SWFObject some data from the item that is binding to the repeater (see the bold code bit below). If i try this...
<asp:Label id="lblVideoTitle" runat="server" text='<%# Container.DataItem("VideoTitle") %>'></asp:Label><br />
<script type="text/javascript" charset="utf-8"><br />
var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8");<br />
so.addVariable("thumbURL",'video_clicker.jpg');<br />
so.addVariable("videoURL",'<%# Container.DataItem("VideoURL") %>');
it simply does not work as it wont break into the ASP like it does with the HTML.
Does anyone know/understand a way around this?
Regards,
Guy
|
|
|
|
|
Just make an external method in javascript that takes the url as input and processes it like:
function DeclareSWF(url)
var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8");
so.addVariable("thumbURL",'video_clicker.jpg');
so.addVariable("videoURL",url);
And in the server code just call it :
DeclareSWF('<%# Container.DataItem("VideoURL") %>')
|
|
|
|
|
Just make an external method in javascript that takes the url as input and processes it like:
<script type="text/javascript">
function DeclareSWF(url)
var so = new SWFObject("vidHolder.swf", "myVideo", "604", "360", "8");
so.addVariable("thumbURL",'video_clicker.jpg');
so.addVariable("videoURL",url);
</script>
And in the server code just call it :
DeclareSWF('<%# Container.DataItem("VideoURL") %>')
About : Islam
About : Me
|
|
|
|
|
but that doesnt solve my problem because you still have to call the javascript and pass a server side variable.
Ive already setup the function in the head of the aspx page but in my repeater i have to break into a script block to call 'DeclareSWF'.
How do you suggest i do that?
Because in the 6 years ive been doing asp.net if never figured it out!
Regards,
Guy
|
|
|
|
|
Hello worldwide developers.
here is my problem:
The business rule is that not just anybody should be allowed to register on the site, so only the users with a role "Property Manager" should be allowed to register new users....
So when she registers a new user, the new user will either be assigned the role "Property Manager" or "landlord"
The issue comes in now because we use the built in register control from the toolbox...which currently does not give an option for selecting roles. So at the moment a new user is not even given a role.
So my question is, how can i manipulate the register control?...or hard code it?...so that the Property Manager can select a role when registering new users.
Hope someone can help.
Thanks people
Dazz
|
|
|
|
|
what is assembly in asp.net? How types of Assembly. How implement in C#.net
Gagan Deep
|
|
|
|
|
see this
http://www.dnzone.com/ShowDetail.asp?NewsId=698
hi
|
|
|
|
|
Assemblies are of three types
1. Private Assemblies
2. Shared Assemblies
3. Sattelite Assemblies
you can look in to google for each of them
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
I'm using itextsharp and I'm having trouble getting the parser to read the html and put it in the pdf.
thx for ur help
BiG RaLpH
|
|
|
|
|
i am using ASP.net with C# and SQL Server2005i am using dataGrid view in an website, it has a an image column which is getting imageURL from a table in database.
i want to display picture through URL of such format
C:\images\abc.jpg
but image i not being displayed, image is displayed ig i use "images/abc.jpg"
can any one tell me how to display image using "C:\images\abc.jpg"
|
|
|
|
|
I don't think is possible. When executing from server, server have accsess only from Root of your specificied server.
But here is a fact.
when using \ in strings, it is intended to be special char
example:
\n - NewLine
\t - tab
\\ - Display \
you have to change.
C:\\images\\abc.jpg
|
|
|
|
|
You need to use virtual path only you can not user physical path in ASP.Net applications I mean you can but it will then find the file to clients hard drive.
Paras Kaneriya The difference between genius and stupidity is that genius has its limits.
|
|
|
|
|
string str = "SELECT cr_name, Trim(cr_pic), FROM criminal";
cr_pic contains image URL "E:\images\abc.jpg"
i want to trim "E:\" Is this possible and what will be the way to do so
|
|
|
|
|
update the table (I mean use the sql query)
Can u solve]
Soniagupta1@yahoo.co.in
|
|
|
|
|
i want to use the trip function in such scenerio
SqlConnection conPubs;
SqlCommand sc;
SqlDataReader dr;
conPubs = new SqlConnection("server=localhost;User ID=sa;Password=sasa;database=rescue15");
conPubs.Open();
string str = "SELECT cr_name, Trim(cr_pic), Trim(fing_print) FROM criminal ORDER BY cr_id DESC";
sc = new SqlCommand(str, conPubs);
dr = sc.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
but i thing i am not using correct sytax fot Trim() can u guide me in this scenario plz
|
|
|
|
|
Try to write a short subject line for your post. Putting the entire question in the subject line makes it too long to be useful.
You can't use C# functions in SQL.
The Trim function is used to remove spaces at the beginning and end of a string. What you need is a function like Substring . Look in the documentation for the SQL syntax of the database you are using.
---
single minded; short sighted; long gone;
|
|
|
|
|
you can use the following query...
string str = "Select cr_name, substring(cr_pic,4,len(cr_pic)-4) from criminal"
“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”
|
|
|
|