Is the any restriction in using currently present Image property? [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to write some property item to image. Though I could not do it. But I can edit any currently added property. So I want to know is there are any property item I can use for my purpose? Here are some Id I am getting:
Id:271
type 2
Id:272
type:2
Id:274
type:3
Id:282
type:5
Id:283
type:5
Id:296
type:3
Id:306
type:2
....
etc.
My question is can I use any of the currently present property?

Sounds simple i think
<img id="myimage" data-id="data you want to pass"/>
if you want to add attribute from c# then
ddLedger.Attributes.Add('data-id','yourvalue');
So you want to access this property at backend c# then
string aa=myimage.attributes("data-id");
in string aa you will get your data....
and in jquery
$('#myimage').attr('data-id');
Now if you want to add it at run time then like this
$('#myimage').attr('data-id','your id added');
Demo
Check this url for more details
https://stackoverflow.com/a/1735239/2630817
I hope this will help you....:)

Related

C# web scraping with HtmlAgilityPack [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want to create application in WPF wchich will scrape information from webpage
I read link to the page from text box at the top
I want to extract company name from h6
I don't understand that format:"//h2[#class='card__title mdc-typography--headline6']". I could't find documentation abot meaning # [] etc. to create another filters to scrape other data for example phone number from tag.
The #, //, ... represent abbreviated syntax for XPath selectors.
#abc is short for attribute::abc
// is short for /descendant-or-self::node()/
So, in other terms, your current query //h2[#class='card__title mdc-typography--headline6'] represents the action of finding the first descendant- or self-node that has a class attribute of card__title mdc-typography--headline6.

ASP.Net Regex Replace Pattern [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Im new on the ASP.Net. I am working on a cart function.
My cart in session.
0001|1,0002|1
productid|quantity,productid|quantity,
How i can use Regex Replace and replace only quantity;
Example; 0001|1 --- > 0001|3 (It will 3 quantities)
Thanks and sorry little english.
I don't really know what you need, but if the quantity is between the two | you can use this code :
(?<=\|)(.*?)(?=\|)
http://imgur.com/a/Wb7s7
If quantity is between the | and the , use this:
(?<=\|)(.*?)(?=\,)
http://imgur.com/a/Ci7pb

What does (int) mean in c#? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I've encountered sometimes code like this and I am kind of new to programming. I want to find out what's the meaning behind those objects or data type enclosed in parenthesis.
(int)
(datagridview)
(form)
If you see something like this it's called a cast. It's used to explicitly convert a data type to another data type.
double pi = 3.14159;
int my_int = (int)pi;
See this description on casting for more details.

Checking Variable before allowing click [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How do I have it check my variable before allowing a click.
Example :
_StartControl.Click += new EventHandler(StartControl_Click);
I only want them to be able to do that if my variable "isValid" is equal to 1.
I'm not very good at forms.. Have always learned just console apps.
You can check the value of your isValid field inside StartControl_Click method. If the value is 1, you can allow the method to proceed, if it's not 1, you can simply return from the method before anything gets executed.
You can do it like this.
if(isValid==1)
_StartControl.Click += new EventHandler(StartControl_Click);

C# webBrowser1.Document - find all elements by class attribute [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm using webBrowser control in winform app C# FW4.0, and I would like to find all the elements that their class attribute contains some value. Is it possible?
You can do this, but it will take some work on your own.
An example on how to find all a tags with class show1 should help you find what you need. Here is an excerpt from the example there
var links = webBrowser1.Document.GetElementsByTagName("a");
foreach (HtmlElement link in links)
{
if (link.GetAttribute("class") == "show1")
{
//do something
}
}

Categories

Resources